# @return [Favourite]
def call(account, status)
favourite = Favourite.create!(account: account, status: status)
- account.ping!(account_url(account, format: 'atom'), [Rails.configuration.x.hub_url])
+ HubPingWorker.perform_async(account.id)
if status.local?
NotificationMailer.favourite(status, account).deliver_later unless status.account.blocking?(account)
end
merge_into_timeline(target_account, source_account)
- source_account.ping!(account_url(source_account, format: 'atom'), [Rails.configuration.x.hub_url])
+ HubPingWorker.perform_async(source_account.id)
follow
end
attach_media(status, media_ids)
process_mentions_service.call(status)
DistributionWorker.perform_async(status.id)
- account.ping!(account_url(account, format: 'atom'), [Rails.configuration.x.hub_url])
+ HubPingWorker.perform_async(account.id)
status
end
def call(account, reblogged_status)
reblog = account.statuses.create!(reblog: reblogged_status, text: '')
DistributionWorker.perform_async(reblog.id)
- account.ping!(account_url(account, format: 'atom'), [Rails.configuration.x.hub_url])
+ HubPingWorker.perform_async(account.id)
if reblogged_status.local?
NotificationMailer.reblog(reblogged_status, account).deliver_later unless reblogged_status.account.blocking?(account)
--- /dev/null
+class HubPingWorker
+ include Sidekiq::Worker
+ include RoutingHelper
+
+ def perform(account_id)
+ account = Account.find(account_id)
+ account.ping!(account_url(account, format: 'atom'), [Rails.configuration.x.hub_url])
+ end
+end