Skip to content

Commit

Permalink
PuSH unsubscribe needs correct callback URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron committed Oct 10, 2016
1 parent aec51e4 commit 65ae963
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/block_domain_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def call(domain)

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!
Expand Down
4 changes: 3 additions & 1 deletion lib/tasks/mastodon.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65ae963

Please sign in to comment.