]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #4852 - Check if already requested from FollowService (#4855)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 9 Sep 2017 00:02:44 +0000 (02:02 +0200)
committerGitHub <noreply@github.com>
Sat, 9 Sep 2017 00:02:44 +0000 (02:02 +0200)
app/services/follow_service.rb

index a92eb6b888150a3a7e92a466c77ed91906625c35..941556b60462f0301dd58652377963fa589fd349 100644 (file)
@@ -12,7 +12,7 @@ class FollowService < BaseService
     raise ActiveRecord::RecordNotFound if target_account.nil? || target_account.id == source_account.id || target_account.suspended?
     raise Mastodon::NotPermittedError  if target_account.blocking?(source_account) || source_account.blocking?(target_account)
 
-    return if source_account.following?(target_account)
+    return if source_account.following?(target_account) || source_account.requested?(target_account)
 
     if target_account.locked? || target_account.activitypub?
       request_follow(source_account, target_account)