about summary refs log tree commit diff
path: root/app/workers/push_update_worker.rb
blob: 5b5e9f68a442d2f479461bc6e81322c41f62b969 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

class PushUpdateWorker
  include Sidekiq::Worker

  def perform(timeline, account_id, status_id)
    account = Account.find(account_id)
    status = Status.find(status_id)
    message = inline_render(account, 'api/v1/statuses/show', status)

    ActionCable.server.broadcast("timeline:#{account_id}", type: 'update', timeline: timeline, message: message)
  end
end