Adding embedded PuSH server
This commit is contained in:
parent
26287b6e7d
commit
2d2c81765b
21 changed files with 262 additions and 8 deletions
15
app/services/pubsubhubbub/unsubscribe_service.rb
Normal file
15
app/services/pubsubhubbub/unsubscribe_service.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Pubsubhubbub::SubscribeService < BaseService
|
||||
def call(account, callback)
|
||||
return ['Invalid topic URL', 422] if account.nil?
|
||||
|
||||
subscription = Subscription.where(account: account, callback_url: callback)
|
||||
|
||||
unless subscription.nil?
|
||||
Pubsubhubbub::ConfirmationWorker.perform_async(subscription.id, 'unsubscribe')
|
||||
end
|
||||
|
||||
['', 202]
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue