AccountConversations

Complete conversation commands and bounded queries.

Functions

Link copied to clipboard
suspend fun count(archived: Boolean = false): UInt

Return the exact number of active or archived conversations.

Link copied to clipboard
suspend fun get(id: ConversationId): Conversation?

Return one complete conversation, or null when it is not stored.

Link copied to clipboard
suspend fun getOrCreate(members: List<PublicKey>): Conversation

Create or return the stable conversation containing members and this account.

Link copied to clipboard
suspend fun hasUnread(includeArchived: Boolean = false): Boolean

Return whether another participant has an unread live message.

Link copied to clipboard
suspend fun markRead(id: ConversationId, boundary: MessageCursor, commandId: CommandId = CommandId.random()): OperationResult

Advance the durable tuple read boundary through boundary.

Link copied to clipboard
suspend fun markUnread(id: ConversationId, commandId: CommandId = CommandId.random()): OperationResult

Force a conversation to remain unread until explicitly marked read again.

Link copied to clipboard

Observe one complete conversation whenever durable account state changes.

fun observe(archived: Boolean = false, cursor: ConversationCursor? = null, limit: Int = 50): Flow<ConversationPage>

Observe a complete bounded page whenever the durable account revision changes.

Link copied to clipboard
fun observeCount(archived: Boolean = false): Flow<UInt>

Observe the exact active or archived conversation count.

Link copied to clipboard
fun observeHasUnread(includeArchived: Boolean = false): Flow<Boolean>

Observe the account-wide unread flag.

Link copied to clipboard

Observe the complete effective cross-device read-state snapshot.

Link copied to clipboard
suspend fun page(archived: Boolean = false, cursor: ConversationCursor? = null, limit: Int = 50): ConversationPage

Return one lossless bounded page, ordered by pin and recent activity.

Link copied to clipboard

Return the complete effective cross-device read-state snapshot.

Link copied to clipboard
suspend fun saveDraft(id: ConversationId, draft: ConversationDraft?)

Save or clear the portable draft for one conversation.

Link copied to clipboard
suspend fun search(query: String, archived: Boolean? = null, limit: Int = 50): List<Conversation>

Search complete conversations by subject, member key, or known name.

Link copied to clipboard
suspend fun setArchived(id: ConversationId, archived: Boolean)

Archive or restore one conversation.

Link copied to clipboard
suspend fun setPinned(id: ConversationId, pinned: Boolean)

Pin or unpin one conversation.