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:
@@ -287,12 +287,21 @@ export interface ActiveCallInfo {
|
|||||||
|
|
||||||
// ─── DM Types ───────────────────────────────────────────────────────────────
|
// ─── 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 {
|
export interface DmChannel {
|
||||||
id: string;
|
id: string;
|
||||||
ownerId?: string | null;
|
ownerId?: string | null;
|
||||||
createdAt: number;
|
createdAt: number;
|
||||||
members: User[];
|
members: User[];
|
||||||
lastMessage?: DmMessage | null;
|
lastMessage?: DmLastMessagePreview | DmMessageWithUser | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DmMessage {
|
export interface DmMessage {
|
||||||
|
|||||||
Reference in New Issue
Block a user