ChatRoomListener

interface ChatRoomListener

Interface for delivering chat room lifecycle events as well as received messages and events.

Functions

Link copied to clipboard
abstract fun onConnected(room: ChatRoom)

Called when room connection is established and user can start sending and receiving messages, occurs when the room transitions into the connected state.

Link copied to clipboard
abstract fun onConnecting(room: ChatRoom)

Called when the room attempts to establish or reestablish socket connection, occurs when the room transitions into connecting state.

Link copied to clipboard
abstract fun onDisconnected(room: ChatRoom, reason: DisconnectReason)

Called when room connection is closed and user is no longer able to send and receive messages, occurs when the room transitions into disconnected state.

Link copied to clipboard
abstract fun onEventReceived(room: ChatRoom, event: ChatEvent)

Called after receiving chat room event.

Link copied to clipboard
abstract fun onMessageDeleted(room: ChatRoom, event: DeleteMessageEvent)

Called after receiving delete message event.

Link copied to clipboard
abstract fun onMessageReceived(room: ChatRoom, message: ChatMessage)

Called after receiving chat room message. The message can be sent by any of the users in the room, including the current user.

Link copied to clipboard
abstract fun onUserDisconnected(room: ChatRoom, event: DisconnectUserEvent)

Called after receiving disconnect user event.