Chats

class Chats

Properties

Link copied to clipboard

Contains the list of chat instances associated with the current user.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
lateinit var currentState: XmppClient.State

Current XMPP session state.

Link copied to clipboard

Returns a Boolean value indicating whether the current XMPPConnection is able to use the file upload feature. If should be called after receiving the event indicating that the xmpp session is authenticated.

Link copied to clipboard
val rx: ChatsRx

Functions

Link copied to clipboard

Adds a listener to receive different chat client events.

Link copied to clipboard

Adds a listener to receive different group chat events.

Link copied to clipboard

Adds a listener to receive different chats events.

Link copied to clipboard
fun connect(isDebugEnabled: Boolean = false, onCompletion: (SippoResourceError?) -> Unit)

Connects a chat session.

Link copied to clipboard
fun createChat(creationType: CreationType, onCompletion: (Either<Chat, SippoResourceError>) -> Unit)

Creates a new chat.

Link copied to clipboard

Disables the Push Notifications for incoming messages. Disables notifications against XMPP server.

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

Disconnects a chat session and disables the chat push notifications. This should be called on logout.

Link copied to clipboard

Enables the Push Notifications for incoming messages. Enable notifications against XMPP server. It must be called after setPushToken or to have the dnd option disabled in order for it to work.

Link copied to clipboard
fun findChatById(identifier: String): Chat?

Find a cached Chat that was identified by the stanzaId.

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

Fetches both individual and group chats related to this user.

Link copied to clipboard

Fetches all group chats related to this user.

Link copied to clipboard

Fetches all individual chats related to this user.

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

Joins all the group chats in the list of currentGroupChats.

Link copied to clipboard

Removes the specified listener.

Link copied to clipboard

Removes the specified listener.

Link copied to clipboard
Link copied to clipboard
fun restore(isDebugEnabled: Boolean = false, onCompletion: (SippoResourceError?) -> Unit)

Restores the active xmpp session.

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

Suspends a chat session. This should be called when the app enters background in order to receive chat push notifications.