conversations

abstract suspend fun conversations(limit: Int, olderThanConversation: Conversation? = null, conversationId: UUID? = null, forceRefresh: Boolean = false): Result<List<Conversation>>

Retrieves conversations available to the local participant.

Return

Result.Success containing the list of conversations, or Result.Error on failure.

Parameters

limit

The maximum number of results to return.

olderThanConversation

The comparison conversation which serves as a base for returning older conversations. If null, the query starts from the newest known conversation.

conversationId

The conversation ID if querying for a particular Conversation.

forceRefresh

Forces the requested data to be refreshed over the network when set to true. Otherwise, the requested data is fetched from the local cache and only refreshed over the network if no results are found locally. Default value is false.

Samples

val result = coreClient.conversations(limit = 20, forceRefresh = true)
if (result is Result.Success) {
    val conversations = result.data
}

abstract suspend fun conversations(limit: Int, sortedByActivityDescending: Boolean = true, olderThanConversation: Conversation? = null): Result<List<Conversation>>

Retrieves conversations from the local cache sorted by latest activity.

This returns results based on locally cached data and may not reflect the real-time state of conversations if the client has not yet retrieved the latest activity from the server. The activity data used for sorting must already exist in local device storage — populate it first by calling conversations with forceRefresh = true or conversationsFlow.

Return

Result.Success containing the list of conversations, or Result.Error on failure.

Parameters

limit

The maximum number of conversations to return.

sortedByActivityDescending

When true, returns conversations with the most recent activity first. Default value is true.

olderThanConversation

The comparison conversation which serves as a base for returning older conversations. If null, the query starts from the newest known conversation.