aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/my-subscriptions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-18 11:13:01 +0100
committerChocobozzz <me@florianbigard.com>2020-11-18 11:32:57 +0100
commitea3674d04dd0a67962224073256dc7d4173527a5 (patch)
tree7a1936b088509b88157e6493c8fb897f06bd29cb /server/controllers/api/users/my-subscriptions.ts
parentaa9cf3b98d5db85fefce918bb29840d0cdcb84c4 (diff)
downloadPeerTube-ea3674d04dd0a67962224073256dc7d4173527a5.tar.gz
PeerTube-ea3674d04dd0a67962224073256dc7d4173527a5.tar.zst
PeerTube-ea3674d04dd0a67962224073256dc7d4173527a5.zip
Remove notifications of muted accounts/servers
Diffstat (limited to 'server/controllers/api/users/my-subscriptions.ts')
-rw-r--r--server/controllers/api/users/my-subscriptions.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts
index b8c234eef..66b33c477 100644
--- a/server/controllers/api/users/my-subscriptions.ts
+++ b/server/controllers/api/users/my-subscriptions.ts
@@ -26,6 +26,7 @@ import {
26} from '../../../middlewares/validators' 26} from '../../../middlewares/validators'
27import { ActorFollowModel } from '../../../models/activitypub/actor-follow' 27import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
28import { VideoModel } from '../../../models/video/video' 28import { VideoModel } from '../../../models/video/video'
29import { sendUndoFollow } from '@server/lib/activitypub/send'
29 30
30const mySubscriptionsRouter = express.Router() 31const mySubscriptionsRouter = express.Router()
31 32
@@ -138,6 +139,8 @@ async function deleteUserSubscription (req: express.Request, res: express.Respon
138 const subscription = res.locals.subscription 139 const subscription = res.locals.subscription
139 140
140 await sequelizeTypescript.transaction(async t => { 141 await sequelizeTypescript.transaction(async t => {
142 if (subscription.state === 'accepted') await sendUndoFollow(subscription, t)
143
141 return subscription.destroy({ transaction: t }) 144 return subscription.destroy({ transaction: t })
142 }) 145 })
143 146