Browse Source

More logging to ConfirmationWorker

closed-social-v3
Eugen Rochko 8 years ago
parent
commit
50638174c8
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      app/workers/pubsubhubbub/confirmation_worker.rb

+ 6
- 2
app/workers/pubsubhubbub/confirmation_worker.rb View File

@ -20,9 +20,13 @@ class Pubsubhubbub::ConfirmationWorker
'hub.lease_seconds' => subscription.lease_seconds,
})
if mode == 'subscribe' && response.body.to_s == challenge
body = response.body.to_s
Rails.logger.debug "Confirming PuSH subscription for #{subscription.callback_url} with challenge #{challenge}: #{body}"
if mode == 'subscribe' && body == challenge
subscription.save!
elsif (mode == 'unsubscribe' && response.body.to_s == challenge) || !subscription.confirmed?
elsif (mode == 'unsubscribe' && body == challenge) || !subscription.confirmed?
subscription.destroy!
end
end

Loading…
Cancel
Save