fix: chat accepts posts
This commit is contained in:
+22
@@ -188,6 +188,25 @@ export type Attachment = {
|
||||
description?: string | null;
|
||||
site_name?: string | null;
|
||||
image_url?: string | null;
|
||||
|
||||
/** Shared entity. `entity` is resolved per viewer on every read, so it can
|
||||
* be absent even though the message still references a post. */
|
||||
entity_type?: "post" | null;
|
||||
entity_id?: string | null;
|
||||
entity?: SharedPost | null;
|
||||
/** The post was deleted, hidden, or is no longer visible to this viewer. */
|
||||
entity_unavailable?: boolean;
|
||||
};
|
||||
|
||||
/** The post card the BFF resolves for a shared-post attachment. */
|
||||
export type SharedPost = {
|
||||
id: string;
|
||||
author_handle: string;
|
||||
author_name: string;
|
||||
author_avatar_url?: string | null;
|
||||
caption: string;
|
||||
image_url?: string | null;
|
||||
source_title?: string;
|
||||
};
|
||||
|
||||
/** How two people in a DM stand with each other. */
|
||||
@@ -261,6 +280,8 @@ export const chat = {
|
||||
previewUrl?: string;
|
||||
attachments?: UploadedAttachment[];
|
||||
quote?: QuotePayload;
|
||||
/** Share a post as a card. Only the reference — the BFF resolves it. */
|
||||
entity?: { type: "post"; id: string };
|
||||
},
|
||||
) =>
|
||||
call<ChatMessage>(`/chat/conversations/${conversationId}/messages`, {
|
||||
@@ -273,6 +294,7 @@ export const chat = {
|
||||
preview_url: opts?.previewUrl ?? null,
|
||||
attachments: opts?.attachments ?? [],
|
||||
quote: opts?.quote ?? null,
|
||||
entity: opts?.entity ?? null,
|
||||
}),
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user