aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/process/process-follow.ts5
-rw-r--r--server/lib/activitypub/process/process-reject.ts3
2 files changed, 7 insertions, 1 deletions
diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts
index 93df7e191..a1958f464 100644
--- a/server/lib/activitypub/process/process-follow.ts
+++ b/server/lib/activitypub/process/process-follow.ts
@@ -58,6 +58,11 @@ async function processFollow (byActor: MActorSignature, activityId: string, targ
58 transaction: t 58 transaction: t
59 }) 59 })
60 60
61 // Already rejected
62 if (actorFollow.state === 'rejected') {
63 return { actorFollow: undefined as MActorFollowActors }
64 }
65
61 // Set the follow as accepted if the remote actor follows a channel or account 66 // Set the follow as accepted if the remote actor follows a channel or account
62 // Or if the instance automatically accepts followers 67 // Or if the instance automatically accepts followers
63 if (actorFollow.state !== 'accepted' && (isFollowingInstance === false || CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false)) { 68 if (actorFollow.state !== 'accepted' && (isFollowingInstance === false || CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false)) {
diff --git a/server/lib/activitypub/process/process-reject.ts b/server/lib/activitypub/process/process-reject.ts
index 7f7ab305f..db7ff24d8 100644
--- a/server/lib/activitypub/process/process-reject.ts
+++ b/server/lib/activitypub/process/process-reject.ts
@@ -25,7 +25,8 @@ async function processReject (follower: MActor, targetActor: MActor) {
25 25
26 if (!actorFollow) throw new Error(`'Unknown actor follow ${follower.id} -> ${targetActor.id}.`) 26 if (!actorFollow) throw new Error(`'Unknown actor follow ${follower.id} -> ${targetActor.id}.`)
27 27
28 await actorFollow.destroy({ transaction: t }) 28 actorFollow.state = 'rejected'
29 await actorFollow.save({ transaction: t })
29 30
30 return undefined 31 return undefined
31 }) 32 })