Package-level declarations

Properties

Link copied to clipboard

GlobalState instance that contains information about the current user, unreads, etc.

Link copied to clipboard

StateRegistry instance that contains all state objects exposed in offline plugin. The instance is being initialized after connecting the user!

Functions

Link copied to clipboard
suspend fun ChatClient.awaitRepliesAsState(messageId: String, messageLimit: Int, olderToNewer: Boolean): ThreadState

Returns thread replies in the form of ThreadState, however, unlike getRepliesAsState it will return it only after the API call made to get replies has ended. Thread state will be returned regardless if the API call has succeeded or failed, the only difference is in how up to date the replies in the thread state are.

Link copied to clipboard

Cancels the message of "ephemeral" type. Removes the message from local storage and state.

Link copied to clipboard

Downloads the selected attachment to the "Download" folder in the public external storage directory.

Link copied to clipboard

Attempts to fetch the message from offline cache before making an API call.

Link copied to clipboard
suspend fun ChatClient.getRepliesAsState(messageId: String, messageLimit: Int, olderToNewer: Boolean, coroutineScope: CoroutineScope = CoroutineScope(DispatcherProvider.IO)): ThreadState

Same class of ChatClient.getReplies, but provides the result as ThreadState

Link copied to clipboard

Loads message for a given message id and channel id.

Link copied to clipboard
fun ChatClient.loadMessagesAroundId(cid: String, messageId: String): Call<Channel>

Loads messages around the given message id.

Link copied to clipboard
fun ChatClient.loadNewerMessages(channelCid: String, baseMessageId: String, messageLimit: Int): Call<Channel>
Link copied to clipboard
fun ChatClient.loadNewestMessages(cid: String, messageLimit: Int, userPresence: Boolean = true): Call<Channel>

Loads the newest messages of a channel.

Link copied to clipboard
fun ChatClient.loadOlderMessages(cid: String, messageLimit: Int): Call<Channel>

Loads older messages for the channel.

Link copied to clipboard
fun ChatClient.queryChannelsAsState(request: QueryChannelsRequest, chatEventHandlerFactory: ChatEventHandlerFactory = ChatEventHandlerFactory(clientState), coroutineScope: CoroutineScope = CoroutineScope(DispatcherProvider.IO)): StateFlow<QueryChannelsState?>

Performs ChatClient.queryChannels under the hood and returns QueryChannelsState associated with the query. The QueryChannelsState cannot be created before connecting the user therefore, the method returns a StateFlow that emits a null when the user has not been connected yet and the new value every time the user changes.

Link copied to clipboard

Set the reply state for the channel.

Link copied to clipboard
fun ChatClient.watchChannelAsState(cid: String, messageLimit: Int, coroutineScope: CoroutineScope = CoroutineScope(DispatcherProvider.IO)): StateFlow<ChannelState?>

Performs ChatClient.queryChannel with watch = true under the hood and returns ChannelState associated with the query. The ChannelState cannot be created before connecting the user therefore, the method returns a StateFlow that emits a null when the user has not been connected yet and the new value every time the user changes.