Don't follow account if it's already followed (#3575)

Closes https://github.com/tootsuite/mastodon/issues/3102
This commit is contained in:
René Klačan
2017-06-05 03:24:18 +02:00
committed by Eugen Rochko
parent f54dca06a9
commit 037f96c5ae
2 changed files with 36 additions and 0 deletions

View File

@ -12,6 +12,8 @@ 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)
if target_account.locked?
request_follow(source_account, target_account)
else