about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-08-21 17:32:41 +0200
committerGitHub <noreply@github.com>2017-08-21 17:32:41 +0200
commit3534e115e5127f12292a84442b46ce93643c6d0d (patch)
treedbfe60842ddc837defb61a087b078cda8c207636 /app/services
parentea958cae7f6c960bdb54214c12de2083ab0e25b0 (diff)
Do not try to re-subscribe to unsubscribed accounts (#4653)
Diffstat (limited to 'app/services')
-rw-r--r--app/services/block_domain_service.rb2
-rw-r--r--app/services/subscribe_service.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/services/block_domain_service.rb b/app/services/block_domain_service.rb
index a6b3c4cdb..1473bc841 100644
--- a/app/services/block_domain_service.rb
+++ b/app/services/block_domain_service.rb
@@ -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
diff --git a/app/services/subscribe_service.rb b/app/services/subscribe_service.rb
index d3e41e691..5617f98f4 100644
--- a/app/services/subscribe_service.rb
+++ b/app/services/subscribe_service.rb
@@ -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