revert: action cable broadcast guard

This commit is contained in:
Sojan Jose
2026-01-20 20:47:52 -08:00
parent c8bbd6bbd8
commit 59bf85d993
+3 -11
View File
@@ -25,17 +25,9 @@ class ActionCableBroadcastJob < ApplicationJob
def prepare_broadcast_data(event_name, data)
return data unless CONVERSATION_UPDATE_EVENTS.include?(event_name)
account_id = data[:account_id]
display_id = data[:id]
return data if account_id.blank? || display_id.blank?
account = Account.find_by(id: account_id)
return data if account.blank?
conversation = account.conversations.find_by(display_id: display_id)
return data if conversation.blank?
conversation.push_event_data.merge(account_id: account_id)
account = Account.find(data[:account_id])
conversation = account.conversations.find_by!(display_id: data[:id])
conversation.push_event_data.merge(account_id: data[:account_id])
end
def broadcast_to_members(members, event_name, broadcast_data)