about summary refs log tree commit diff
path: root/app/lib/activitypub/activity
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-02-28 06:55:06 +0100
committerGitHub <noreply@github.com>2018-02-28 06:55:06 +0100
commite85287284611f7de431d9c51353125c265ebfe3f (patch)
tree14ae8d7a560ffd6628e4a54092dd8a91e0a2f66a /app/lib/activitypub/activity
parent41a01bec2337e7021634f2e9c78d86a1c3002fcf (diff)
Fix #5708: Reject->Follow will remove the follow if it exists (#6571)
Diffstat (limited to 'app/lib/activitypub/activity')
-rw-r--r--app/lib/activitypub/activity/reject.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/lib/activitypub/activity/reject.rb b/app/lib/activitypub/activity/reject.rb
index d815feeb6..28d472883 100644
--- a/app/lib/activitypub/activity/reject.rb
+++ b/app/lib/activitypub/activity/reject.rb
@@ -17,6 +17,8 @@ class ActivityPub::Activity::Reject < ActivityPub::Activity
 
     follow_request = FollowRequest.find_by(account: target_account, target_account: @account)
     follow_request&.reject!
+
+    UnfollowService.new.call(target_account, @account) if target_account.following?(@account)
   end
 
   def target_uri