diff options
author | ThibG <thib@sitedethib.com> | 2019-07-21 00:53:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-21 00:53:28 +0200 |
commit | f1597e1ab90b1fb291f16977877c6ca79bf89676 (patch) | |
tree | 7cb8facbd66c2199e173d2fc897863108b1fb398 /app/services/pubsubhubbub/unsubscribe_service.rb | |
parent | 19c3a941e8ac53a6e1ab6e9c0aaadbc53dd0050f (diff) | |
parent | 055450bc02732f654317096f56b03b77f5b84270 (diff) |
Merge pull request #1158 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/pubsubhubbub/unsubscribe_service.rb')
-rw-r--r-- | app/services/pubsubhubbub/unsubscribe_service.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/app/services/pubsubhubbub/unsubscribe_service.rb b/app/services/pubsubhubbub/unsubscribe_service.rb deleted file mode 100644 index 646150f7b..000000000 --- a/app/services/pubsubhubbub/unsubscribe_service.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class Pubsubhubbub::UnsubscribeService < BaseService - attr_reader :account, :callback - - def call(account, callback) - @account = account - @callback = Addressable::URI.parse(callback).normalize.to_s - - process_unsubscribe - end - - private - - def process_unsubscribe - if account.nil? - ['Invalid topic URL', 422] - else - confirm_unsubscribe unless subscription.nil? - ['', 202] - end - end - - def confirm_unsubscribe - Pubsubhubbub::ConfirmationWorker.perform_async(subscription.id, 'unsubscribe') - end - - def subscription - @_subscription ||= Subscription.find_by(account: account, callback_url: callback) - end -end |