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

Properties

Link copied to clipboard
val currentMessages: List<XMPPMessage>
Link copied to clipboard
Link copied to clipboard
val lastMessage: XMPPMessage?
Link copied to clipboard
Link copied to clipboard
val rx: ChatRx

Access to the reactive API of the chat.

Link copied to clipboard
Link copied to clipboard
val type: ChatType
Link copied to clipboard
Link copied to clipboard
val xmppJid: XmppJid

Functions

Link copied to clipboard
fun addListener(listener: ChatListener)

Adds a listener to receive chat events.

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

Archives a one to one chat.

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

Removes a MUC chat.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
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
open override fun hashCode(): Int
Link copied to clipboard
fun invite(userId: String, onCompletion: (SippoResourceError?) -> Unit)

Adds a new participant to the current chat.

fun invite(userIds: List<String>, onCompletion: (SippoResourceError?) -> Unit)

Adds a list of participants to the current chat.

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

Sends a special message asking the recipient to join the room associated to the current chat. This method has no effect for individual chats.

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

Removes a participant from the current chat.

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

Marks all messages as viewed since the last message received.

Link copied to clipboard

Removes the specified listener.

Link copied to clipboard
fun sendFile(file: File, onCompletion: (SippoResourceError?) -> Unit)

Uploads the file and sends its URI as a message to this chat.

Link copied to clipboard

Uploads the file and sends its URI as a message to this chat.

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

Sends a text message to this chat.

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

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