Add events for current_content and connection_status

This commit is contained in:
kiragrammel
2023-09-13 17:37:51 +02:00
committed by Sebastian Serth
parent 5ae306997b
commit 49e3fa6176
2 changed files with 22 additions and 3 deletions

View File

@ -43,10 +43,14 @@ class SynchronizedEditorChannel < ApplicationCable::Channel
end
def connection_status
ActionCable.server.broadcast(specific_channel, create_message('connection_status', 'connected'))
message = create_message('connection_status', 'connected')
Event::SynchronizedEditor.create_for_connection_change(message, current_user, programming_group)
ActionCable.server.broadcast(specific_channel, message)
end
def current_content(message)
Event::SynchronizedEditor.create_for_current_content(message, current_user, programming_group)
ActionCable.server.broadcast(specific_channel, message)
end