Instantly upgrade account to ActivityPub if we receive ActivityPub payload (#4766)

remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
Eugen Rochko 2017-09-03 01:11:23 +02:00 committed by GitHub
parent 5d170587e3
commit a187dcefa1
2 changed files with 17 additions and 2 deletions

View File

@ -26,8 +26,12 @@ class ActivityPub::InboxesController < Api::BaseController
end end
def upgrade_account def upgrade_account
return unless signed_request_account.subscribed? if signed_request_account.ostatus?
Pubsubhubbub::UnsubscribeWorker.perform_async(signed_request_account.id) signed_request_account.update(last_webfingered_at: nil)
ResolveRemoteAccountWorker.perform_async(signed_request_account.acct)
end
Pubsubhubbub::UnsubscribeWorker.perform_async(signed_request_account.id) if signed_request_account.subscribed?
end end
def process_payload def process_payload

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class ResolveRemoteAccountWorker
include Sidekiq::Worker
sidekiq_options queue: 'pull', unique: :until_executed
def perform(uri)
ResolveRemoteAccountService.new.call(uri)
end
end