forked from cybrespace/mastodon
PuSH unsubscribe needs correct callback URL
This commit is contained in:
parent
aec51e40ee
commit
65ae9637d6
|
@ -4,7 +4,7 @@ class BlockDomainService < BaseService
|
||||||
|
|
||||||
Account.where(domain: domain).find_each do |account|
|
Account.where(domain: domain).find_each do |account|
|
||||||
if account.subscribed?
|
if account.subscribed?
|
||||||
account.subscription('').unsubscribe
|
account.subscription(api_subscription_url(account.id)).unsubscribe
|
||||||
end
|
end
|
||||||
|
|
||||||
account.destroy!
|
account.destroy!
|
||||||
|
|
|
@ -11,11 +11,13 @@ namespace :mastodon do
|
||||||
namespace :push do
|
namespace :push do
|
||||||
desc 'Unsubscribes from PuSH updates of feeds nobody follows locally'
|
desc 'Unsubscribes from PuSH updates of feeds nobody follows locally'
|
||||||
task clear: :environment do
|
task clear: :environment do
|
||||||
|
include RoutingHelper
|
||||||
|
|
||||||
Account.remote.without_followers.find_each do |a|
|
Account.remote.without_followers.find_each do |a|
|
||||||
Rails.logger.debug "PuSH unsubscribing from #{a.acct}"
|
Rails.logger.debug "PuSH unsubscribing from #{a.acct}"
|
||||||
|
|
||||||
begin
|
begin
|
||||||
a.subscription('').unsubscribe
|
a.subscription(api_subscription_url(a.id)).unsubscribe
|
||||||
rescue HTTP::Error, OpenSSL::SSL::SSLError
|
rescue HTTP::Error, OpenSSL::SSL::SSLError
|
||||||
Rails.logger.debug "PuSH unsubscribing from #{a.acct} failed due to an HTTP or SSL error"
|
Rails.logger.debug "PuSH unsubscribing from #{a.acct} failed due to an HTTP or SSL error"
|
||||||
ensure
|
ensure
|
||||||
|
|
Loading…
Reference in New Issue