# ChatListener

interface ChatListener

A listener to receive events for a specific chat.

This interface includes the callback needed to listen to the chat client state events and to perform the appropriate actions when one of these events are received.

## Functions

onChatStateChanged
Link copied to clipboard
abstract fun onChatStateChanged(chat: Chat, state: ChatState)

Performs any actions that could be required depending on the chat state.

onNewMessage
Link copied to clipboard
abstract fun onNewMessage(chat: Chat, message: XMPPMessage)

Performs any actions that could be required when a new message is received.

onParticipantsUpdated
Link copied to clipboard
abstract fun onParticipantsUpdated(chat: Chat, participants: List<ChatContact>)

Performs any actions that could be required when chat participants are updated.

onUnreadMessages
Link copied to clipboard
abstract fun onUnreadMessages(chat: Chat, count: Int)

Performs any actions that could be required when the unread message counter is updated.