messaging: owners can block a conversation

A blocked thread key is dropped unread (not announced, not counted against
the daily new-conversation limit). API, UI button with confirmation, and a
list with unblock.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 20:50:38 +01:00
co-authored by Claude Sonnet 5.5
parent a54094ea35
commit 13c82f8d59
14 changed files with 433 additions and 3 deletions
+18
View File
@@ -157,6 +157,24 @@ export async function deleteThread(listing: string, thread: string): Promise<voi
await call("DELETE", `/api/v1/inbox/${e(listing)}/${e(thread)}`);
}
export async function blockThread(listing: string, thread: string): Promise<void> {
await call("PUT", `/api/v1/inbox/${e(listing)}/${e(thread)}/block`);
}
export async function unblockThread(listing: string, thread: string): Promise<void> {
await call("DELETE", `/api/v1/inbox/${e(listing)}/${e(thread)}/block`);
}
export interface Blocked {
listing: string;
thread: string;
blocked_at: number;
}
export async function getBlocked(): Promise<Blocked[]> {
return (await call("GET", "/api/v1/blocked")) as Blocked[];
}
/** The saved address of a listing, or null if none is saved. */
export async function getAddress(listing: string): Promise<Address | null> {
try {