]> cat aescling's git repositories - mastodon.git/commitdiff
PuSH unsubscribe needs correct callback URL
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 10 Oct 2016 01:40:08 +0000 (03:40 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 10 Oct 2016 01:40:08 +0000 (03:40 +0200)
app/services/block_domain_service.rb
lib/tasks/mastodon.rake

index 075460605ec533cc3f2849c103868e12564a224a..ac658a050e16e977094326f7e5e41bf14e9b928a 100644 (file)
@@ -4,7 +4,7 @@ class BlockDomainService < BaseService
 
     Account.where(domain: domain).find_each do |account|
       if account.subscribed?
-        account.subscription('').unsubscribe
+        account.subscription(api_subscription_url(account.id)).unsubscribe
       end
 
       account.destroy!
index 872b33cdd201e73368fa266601a7c45719010708..29e4494c4023b0d59393a3fca00b0e77e27b0f58 100644 (file)
@@ -11,11 +11,13 @@ namespace :mastodon do
   namespace :push do
     desc 'Unsubscribes from PuSH updates of feeds nobody follows locally'
     task clear: :environment do
+      include RoutingHelper
+
       Account.remote.without_followers.find_each do |a|
         Rails.logger.debug "PuSH unsubscribing from #{a.acct}"
 
         begin
-          a.subscription('').unsubscribe
+          a.subscription(api_subscription_url(a.id)).unsubscribe
         rescue HTTP::Error, OpenSSL::SSL::SSLError
           Rails.logger.debug "PuSH unsubscribing from #{a.acct} failed due to an HTTP or SSL error"
         ensure