Chats

class Chats

Functions

Link copied to clipboard
fun addListener(listener: ChatClientListener)

Adds a listener to receive different chat client events.

fun addListener(listener: ChatsListener)

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: (SippoResourceError?) -> Unit)

Creates a new chat.

Link copied to clipboard
fun disconnect()

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

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

Find a cached Chat that was identified by the stanzaId.

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

Fetches all individual chats related to this user.

Link copied to clipboard
fun removeListener(listener: ChatClientListener)
fun removeListener(listener: ChatsListener)

Removes the specified listener.

Link copied to clipboard
fun suspend()

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

Properties

Link copied to clipboard
val chats: List<Chat>
Link copied to clipboard
lateinit var currentState: XmppClient.State

Current XMPP session state.

Link copied to clipboard
val rx: ChatsRx