Expand description
Chat database operations — CRUD for the chats table.
Structs§
- Slim
ChatDB - Slim version of Chat for database storage.
Functions§
- clear_
chat_ last_ read - Upsert a chat to the database.
Clear a chat’s read marker to never-read. The
save_slim_chatupsert deliberately refuses to regresslast_readto empty (a partially-hydrated STATE chat would otherwise wipe the stored position), so a DELIBERATE clear — Mark as Unread on a chat whose only message is the target — must come through here or it silently no-ops. - delete_
chat - Delete a chat and all its messages from the database.
chat_identifieris the string id (npub for DMs, channel id for Communities) — NOT the integer PK. - get_
all_ chats - Get all chats from the database.
- save_
slim_ chat