aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/user-subscriptions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-26 14:46:15 +0200
committerChocobozzz <me@florianbigard.com>2022-07-27 13:52:13 +0200
commit927fa4b11f692174d6296aa096d7a74bacdeea8b (patch)
tree20866dda219bbb5504d5645a980565fbbc25398a /server/middlewares/validators/user-subscriptions.ts
parent0f58b11f5cace6e57cab5b4a18380eb297b43fe4 (diff)
downloadPeerTube-927fa4b11f692174d6296aa096d7a74bacdeea8b.tar.gz
PeerTube-927fa4b11f692174d6296aa096d7a74bacdeea8b.tar.zst
PeerTube-927fa4b11f692174d6296aa096d7a74bacdeea8b.zip
Add rejected state to follows
Prevent reprocessing already rejected follows
Diffstat (limited to 'server/middlewares/validators/user-subscriptions.ts')
-rw-r--r--server/middlewares/validators/user-subscriptions.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts
index 48ce90d7b..73da3142a 100644
--- a/server/middlewares/validators/user-subscriptions.ts
+++ b/server/middlewares/validators/user-subscriptions.ts
@@ -58,7 +58,12 @@ const userSubscriptionGetValidator = [
58 if (host === WEBSERVER.HOST) host = null 58 if (host === WEBSERVER.HOST) host = null
59 59
60 const user = res.locals.oauth.token.User 60 const user = res.locals.oauth.token.User
61 const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(user.Account.Actor.id, name, host) 61 const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI({
62 actorId: user.Account.Actor.id,
63 targetName: name,
64 targetHost: host,
65 state: 'accepted'
66 })
62 67
63 if (!subscription || !subscription.ActorFollowing.VideoChannel) { 68 if (!subscription || !subscription.ActorFollowing.VideoChannel) {
64 return res.fail({ 69 return res.fail({