Do not try to re-subscribe to unsubscribed accounts (#4653)
This commit is contained in:
@@ -30,7 +30,7 @@ class BlockDomainService < BaseService
|
||||
|
||||
def suspend_accounts!
|
||||
blocked_domain_accounts.where(suspended: false).find_each do |account|
|
||||
account.subscription(api_subscription_url(account.id)).unsubscribe if account.subscribed?
|
||||
UnsubscribeService.new.call(account) if account.subscribed?
|
||||
SuspendAccountService.new.call(account)
|
||||
end
|
||||
end
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
class SubscribeService < BaseService
|
||||
def call(account)
|
||||
return unless account.ostatus?
|
||||
return if account.hub_url.blank?
|
||||
|
||||
@account = account
|
||||
@account.secret = SecureRandom.hex
|
||||
|
Reference in New Issue
Block a user