Chat

class Chat

A chat instance.

This class allows performing actions over this specific chat like deleting the chat, sending a message or get the message history list

Functions

Link copied to clipboard
fun delete(onCompletion: (SippoResourceError?) -> Unit)

Removes a one to one chat.

Link copied to clipboard
fun fetchLastMessages(onCompletion: (Either<List<XMPPMessage>, SippoResourceError>) -> Unit)

Retrieves the last messages available to the current chat. The maximum number of messages to be obtained from the server if available is 15.

Link copied to clipboard
fun fetchMessagesBy(query: MessageQuery, onCompletion: (Either<List<XMPPMessage>, SippoResourceError>) -> Unit)

Retrieves the messages available to the current chat within the specified query.

Link copied to clipboard
fun markAsDisplayed()

Marks all messages as viewed since the last message received.

Link copied to clipboard
fun sendMessage(message: String, onCompletion: (SippoResourceError?) -> Unit)

Sends a text message to this chat.

Link copied to clipboard
fun setStatus(state: XMPPChatState, onCompletion: (SippoResourceError?) -> Unit)

Sets the current state of current chat instance. This method will send an empty Message with the state attached.

Properties

Link copied to clipboard
val currentMessages: List<XMPPMessage>
Link copied to clipboard
val identifier: String
Link copied to clipboard
val lastMessage: XMPPMessage?
Link copied to clipboard
val participant: Contact?
Link copied to clipboard
val rx: ChatRx

Access to the reactive API of the chat.

Link copied to clipboard
val title: String
Link copied to clipboard
val type: ChatType
Link copied to clipboard
val unreadMessages: Int