feat(shared): add DmLastMessagePreview type with attachment metadata

Introduces a lightweight DmLastMessagePreview interface for the ready
payload and GET /api/dm response, and widens DmChannel.lastMessage to
accept either DmLastMessagePreview or DmMessageWithUser so both the
static preview path and real-time WS events can coexist without casts.
This commit is contained in:
Jannis Braun
2026-04-02 17:45:23 +02:00
parent c9d2423c38
commit 416636530a
+10 -1
View File
@@ -287,12 +287,21 @@ export interface ActiveCallInfo {
// ─── DM Types ───────────────────────────────────────────────────────────────
export interface DmLastMessagePreview {
id: string;
dmChannelId: string;
userId: string;
content: string | null;
createdAt: number;
attachments?: Array<{ type: string; filename: string }>;
}
export interface DmChannel {
id: string;
ownerId?: string | null;
createdAt: number;
members: User[];
lastMessage?: DmMessage | null;
lastMessage?: DmLastMessagePreview | DmMessageWithUser | null;
}
export interface DmMessage {