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. - drop_
held_ wallpaper_ before - Withdraw a held wallpaper older than
created_at(its sender since removed it). - get_
all_ chats - Get all chats from the database.
- hold_
wallpaper - Keep a wallpaper rumor (sealed at rest) until its chat’s request is accepted; only a newer one replaces it. Whether it was kept.
- save_
slim_ chat - take_
held_ wallpaper - The wallpaper held for this chat, removed as it’s handed over.