ChatRx

class ChatRx(type: ChatType, jid: XmppJid, participants: MutableSet<ChatContact>, chatService: ChatService, agenda: Agenda, xmppChat: 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, jid: XmppJid, participants: MutableSet<ChatContact>, chatService: ChatService, agenda: Agenda, xmppChat: XMPPChat)

Functions

Link copied to clipboard
fun archive(): Completable

Archives a one to one chat.

Link copied to clipboard
fun delete(): Completable

Removes a MUC 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 invite(userId: String): Completable

Adds a new participant to the current chat.

fun invite(userIds: List<String>): Completable

Adds a list of participants to the current chat.

Link copied to clipboard
fun join(): Completable

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): Completable

Removes a participant from the current chat.

Link copied to clipboard
fun markAsDisplayed(): Completable

Marks all messages as viewed since the last message received.

Link copied to clipboard
fun sendFile(file: File): Completable

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

Link copied to clipboard
fun sendFileProgress(file: File): Observable<FileUploadState>

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

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

Sends a text message to this chat.

Link copied to clipboard
fun setStatus(query: XMPPChatStateQuery): 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<ChatState>
Link copied to clipboard
val currentMessages: List<XMPPMessage>
Link copied to clipboard
val currentParticipants: Observable<List<ChatContact>>
Link copied to clipboard
lateinit var currentStatus: ChatState
Link copied to clipboard
val newMessage: Observable<XMPPMessage>
Link copied to clipboard
val unreadMessages: Observable<Int>