MessageViewModel
Constructors
Properties
The currently focused search result message (for scroll-to-match).
Persisted draft for the conversation on screen. Null until loadDraft has read it back.
Whether on-device translation into the current locale is possible (always false on F-Droid/desktop).
Functions
Returns a non-paged reactive Flow of messages for a conversation. Used by desktop targets that don't use paging-compose.
Reads the stored draft for contactKey once per conversation.
Marks contactKey as the conversation on screen so an arriving message for it is not also announced as a notification. Paired with onConversationHidden on pause — backgrounding the app hides the screen, which is what makes a single signal enough.
Sends a message to a contact or channel.
Updates the in-memory draft immediately; the durable writes are debounced by DRAFT_PERSISTENCE_DELAY_MS, so rapid edits cancel the prior pending flush and only the trailing value persists. On process death within that window the last ≤DRAFT_PERSISTENCE_DELAY_MS of typing is not durably saved — a conscious trade-off to avoid per-keystroke jank.
Translates message into the device language, or just re-shows a previously persisted translation.