]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-follow.ts
Fix channel follow with manually approved follower
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-follow.ts
index da660bda333503851d9a44b199b46be12d072c4e..7def753d52c7277cb5890705c1a5c20a213f6cd2 100644 (file)
@@ -47,7 +47,7 @@ async function processFollow (byActor: MActorSignature, activityId: string, targ
       byActor,
       targetActor,
       activityId,
-      state: CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL
+      state: await isFollowingInstance(targetActor) && CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL
         ? 'pending'
         : 'accepted',
       transaction: t
@@ -134,7 +134,7 @@ async function acceptIfNeeded (actorFollow: MActorFollow, targetActor: MActorFul
   // Or if the instance automatically accepts followers
   if (actorFollow.state === 'accepted') return
   if (!await isFollowingInstance(targetActor)) return
-  if (CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === true) return
+  if (CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === true && await isFollowingInstance(targetActor)) return
 
   actorFollow.state = 'accepted'