]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #5708: Reject->Follow will remove the follow if it exists (#6571)
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 28 Feb 2018 05:55:06 +0000 (06:55 +0100)
committerGitHub <noreply@github.com>
Wed, 28 Feb 2018 05:55:06 +0000 (06:55 +0100)
app/lib/activitypub/activity/reject.rb

index d815feeb6c0d19e6fa7113cadf29296d75ec2cb9..28d472883f2748be37385033f1106e9d4c6ea79c 100644 (file)
@@ -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