send

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.

Pass the exact portable composer snapshot as draftToConsume when this command owns it. If local edits may be ahead of a debounced save, persist that snapshot with AccountConversations.saveDraft first. Rust clears that draft in the same SQLite transaction as the local message and outgoing recipient copies only if the stored semantic content still matches. A newer autosave is preserved even when it commits before this command acquires SQLite. Replaying the same commandId returns the original result without touching the current draft; changing draftToConsume on a replay is a command conflict.

Guide