This channel receives all updates regarding messaging which are specific to a member, all other events from a room which are common for all members are communicated on chat room channel.
Please note that same event is broadcasted on chat-room-#{chat_room.id}-channel channel on updating room specific attributes like :pinned_message_id, :show_history, :description, :name attributes.
This event gets broadcasted on chat room deletion.
Additional information received with the event:
{
chat_room_uuid: string
}
chatRoomRead
This event gets broadcasted when chatroom gets marked as read by a participant.
Additional information received with the event:
{
chat_room_uuid: string
}
chatRoomPinned
This event gets broadcasted when a non embedded chat room is pinned by a community member.
Additional information received with the event:
{
chat_room_id: number
pinned_at: string
}
chatRoomUnPinned
This event gets broadcasted when a non embedded chat room is un-pinned by a community member.
Additional information received with the event:
{
chat_room_id: number
}
ChatRoomMessage events:
newMessage
This event gets broadcasted for each new non reply message in a non embedded chat room.
Additional information received with the event:
interface JSONMessage {
id: number;
chat_room_uuid: string;
chat_room_kind: string;
chat_room_participant_id: number; // Assuming this is a number based on previous examples
body: string;
rich_text_body: Record<string, any>;
sent_at: string;
created_at: string;
sender: Record<string, any>;
creation_uuid: string;
chat_thread_id: number;
parent_message_id: number;
lesson_id: number;
edited_at: string;
replies_count: number;
total_thread_participants_count: number;
thread_participants_preview: Record<string, any>;
chat_thread_replies_count: number;
}
Note: We are broadcasting exact same event on chat-room-#{chat_room.id}-channel currently for all new messages including replies. This is sent for all embedded and non embedded rooms.
chat-room-#{chat_room.id}-channel
We are using this channel to post chat room events which are not intended for a specific community member.
Channel details:
Name: *Chats*::*RoomChannel*
Pubsub queue: chat-room-#{*chat_room*.id}-channel
Events:
ChatRoomMessage events:
newMessage
This event gets broadcasted for each new message in the chat room
Additional information received with the event:
interface JSONMessage {
id: number;
chat_room_uuid: string;
chat_room_kind: string;
chat_room_participant_id: number; // Assuming this is a number based on previous examples
body: string;
rich_text_body: Record<string, any>;
sent_at: string;
created_at: string;
sender: Record<string, any>;
creation_uuid: string;
chat_thread_id: number;
parent_message_id: number;
lesson_id: number;
edited_at: string;
replies_count: number;
total_thread_participants_count: number;
thread_participants_preview: Record<string, any>;
chat_thread_replies_count: number;
}
deletedMessage
This event gets broadcasted when a message gets deleted from the chat room
Additional information received with the event:
interface ParentMessage {
id: number;
chat_room_uuid: string;
chat_room_participant_id: number; // Assuming this is a number based on previous examples
body: string;
rich_text_body: Record<string, any>;
sent_at: string;
created_at: string;
sender: Record<string, any>;
creation_uuid: string;
chat_thread_id: number;
parent_message_id: number;
lesson_id: number;
edited_at: string;
replies_count: number;
total_thread_participants_count: number;
thread_participants_preview: Record<string, any>;
}
interface MessageWithParent {
id: number;
parent_message: ParentMessage;
}
updatedMessage
This event gets broadcasted when a message is updated
Additional information received with the event:
interface JSONMessage {
id: number;
chat_room_uuid: string;
chat_room_participant_id: number; // Assuming this is a number based on previous examples
body: string;
rich_text_body: Record<string, any>;
sent_at: string;
created_at: string;
sender: Record<string, any>;
creation_uuid: string;
chat_thread_id: number;
parent_message_id: number;
lesson_id: number;
edited_at: string;
replies_count: number;
total_thread_participants_count: number;
thread_participants_preview: Record<string, any>;
}
This event gets broadcasted for each new message in the chat thread.
Additional information received with the event:
interface JSONMessage {
id: number;
chat_room_uuid: string;
chat_room_kind: string;
chat_room_participant_id: number; // Assuming this is a number based on previous examples
body: string;
rich_text_body: Record<string, any>;
sent_at: string;
created_at: string;
sender: Record<string, any>;
creation_uuid: string;
chat_thread_id: number;
parent_message_id: number;
lesson_id: number;
edited_at: string;
replies_count: number;
total_thread_participants_count: number;
thread_participants_preview: Record<string, any>;
chat_thread_replies_count: number;
}
updatedMessage
This event gets broadcasted when a message is updated in chat thread
Additional information received with the event:
interface ChatMessage {
id: number;
chat_room_uuid: string;
chat_room_participant_id: number; // Assuming this is a number based on the comment
body: string;
rich_text_body: Record<string, any>; // Using Record for a generic object type
sent_at: string;
created_at: string;
sender: Record<string, any>;
creation_uuid: string;
chat_thread_id: number;
parent_message_id: number;
lesson_id: number;
edited_at: string;
replies_count: number;
total_thread_participants_count: number;
thread_participants_preview: Record<string, any>;
}
deletedMessage
This event gets broadcasted when a message gets deleted from the chat thread