feat(shared): mark_attachment_viewed + view_once on AttachmentHandle
This commit is contained in:
@@ -25,6 +25,16 @@ export interface AttachmentHandle {
|
||||
// base64-encoded — only readable via per-device envelope decrypt.
|
||||
keyB64: string;
|
||||
nonceB64: string;
|
||||
/** View-once flag — set by sender on the encrypted envelope and mirrored
|
||||
* to `message_attachments.view_once` so the renderer can show a "tap to
|
||||
* view" tombstone and call the mark-viewed RPC on first open. */
|
||||
viewOnce?: boolean;
|
||||
/** ISO timestamp the first non-sender opened the attachment. Populated by
|
||||
* the mark-viewed RPC (server-authoritative); undefined until burnt. */
|
||||
viewedAt?: string | null;
|
||||
/** UUID of the first non-sender who viewed. Populated alongside `viewedAt`
|
||||
* by the mark-viewed RPC so the renderer can render attribution. */
|
||||
viewedBy?: string | null;
|
||||
}
|
||||
|
||||
export type CallEventStatus = 'ended' | 'missed' | 'declined';
|
||||
@@ -256,6 +266,7 @@ export async function insertAttachmentRow(
|
||||
nonce: blobNonceHex,
|
||||
mime_type: handle.mimeType,
|
||||
size_bytes: handle.sizeBytes,
|
||||
view_once: handle.viewOnce ?? false,
|
||||
};
|
||||
if (handle.width !== undefined) row.width = handle.width;
|
||||
if (handle.height !== undefined) row.height = handle.height;
|
||||
|
||||
Reference in New Issue
Block a user