ChatRx

class ChatRx(type: ChatType, identifier: String, participant: Contact?, chatService: ChatService, oneToOneChat: XMPPChat)

Reactive API of Chat.

This class replicates some of the methods included in Chat but using Rx types as return values instead of callbacks.

Constructors

Link copied to clipboard
fun ChatRx(type: ChatType, identifier: String, participant: Contact?, chatService: ChatService, oneToOneChat: XMPPChat)

Functions

Link copied to clipboard
fun delete(): Completable

Removes a one to one chat.

Link copied to clipboard
fun fetchLastMessages(): Single<List<XMPPMessage>>

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): Single<List<XMPPMessage>>

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

Link copied to clipboard
fun sendMessage(message: String): Completable

Sends a text message to this chat.

Link copied to clipboard
fun setStatus(state: XMPPChatState): Completable

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 chatStatus: Observable<XMPPChatState>
Link copied to clipboard
val currentMessages: List<XMPPMessage>
Link copied to clipboard
val newMessage: Observable<XMPPMessage>
Link copied to clipboard
val unreadMessages: Observable<Int>