AccountMessages

Complete high-level messaging commands and bounded effective-message queries.

Functions

Link copied to clipboard
suspend fun context(messageId: MessageId, before: Int = 25, after: Int = 25): List<Message>

Return a bounded stable context centered on messageId.

Link copied to clipboard
suspend fun delete(commandId: CommandId, messageId: MessageId): OperationResult

Delete one locally authored stored message.

Link copied to clipboard
suspend fun deleteMany(commandId: CommandId, messageIds: List<MessageId>): OperationResult

Atomically delete a bounded selection of this account's messages in one conversation.

Link copied to clipboard
suspend fun edit(commandId: CommandId, messageId: MessageId, replacement: MessageContent): OperationResult

Replace text and custom-emoji tags on one locally authored message.

Link copied to clipboard
suspend fun forward(commandId: CommandId, messageId: MessageId, destination: ConversationId): OperationResult

Forward one stored authenticated message into another conversation.

Link copied to clipboard
suspend fun get(id: MessageId): Message?

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

Link copied to clipboard
suspend fun getMany(ids: List<MessageId>): List<Message>

Return up to 512 unique exact messages in caller order. Unknown IDs are omitted.

Link copied to clipboard
suspend fun localExtras(messageId: MessageId): MessageLocalExtras?

Return sparse local transcript and normalized waveform data, when present.

Link copied to clipboard
fun observe(conversationId: ConversationId, cursor: MessageCursor? = null, limit: Int = 50): Flow<MessagePage>

Observe a complete bounded page whenever durable account state changes.

Link copied to clipboard

Observe sparse local extras after durable account changes.

Link copied to clipboard

Observe the same bounded exact ID set after durable account changes.

Link copied to clipboard
suspend fun page(conversationId: ConversationId, cursor: MessageCursor? = null, limit: Int = 50): MessagePage

Return one lossless newest-first bounded page.

Link copied to clipboard
suspend fun replies(messageId: MessageId, cursor: MessageCursor? = null, limit: Int = 50): MessagePage

Page direct replies in the root conversation, newest first, including deletion tombstones. Unrelated messages and forwards cannot truncate the result. Unknown roots return an empty page.

Link copied to clipboard
suspend fun search(query: String, conversationId: ConversationId? = null, limit: Int = 50): List<Message>

Search effective authenticated live message text through Rust-owned FTS5.

Link copied to clipboard
suspend fun send(commandId: CommandId, conversationId: ConversationId, content: MessageContent, replyTo: MessageId? = null, draftToConsume: ConversationDraft? = null): OperationResult

Atomically author, locally project, and queue one idempotent message.

Link copied to clipboard
suspend fun setLocalExtras(messageId: MessageId, transcript: String?, waveform: ByteArray = byteArrayOf())

Replace sparse local transcript and normalized waveform data.

Link copied to clipboard
suspend fun setSubject(commandId: CommandId, conversationId: ConversationId, subject: String, icon: AttachmentMetadata? = null, emojiTags: List<List<String>> = emptyList()): OperationResult

Publish a subject and optional uploaded icon for one conversation.

Link copied to clipboard
suspend fun toggleReaction(commandId: CommandId, messageId: MessageId, reaction: Reaction): OperationResult

Toggle the local account's matching reaction on one stored message.

Link copied to clipboard
suspend fun typingChanged(commandId: CommandId, conversationId: ConversationId, isTyping: Boolean): OperationResult?

Publish an ephemeral typing change when enabled by account settings.