feat: add real media albums across backend, web, and android
- add backend media-group endpoint with atomic message and attachment creation - switch web composer to send multi-media albums through the new endpoint - switch Android batch media sending to upload first and create one album message with caption
This commit is contained in:
@@ -106,6 +106,42 @@ export async function sendMessageWithClientId(
|
||||
return data;
|
||||
}
|
||||
|
||||
export interface MediaGroupAttachmentInput {
|
||||
file_url: string;
|
||||
file_type: string;
|
||||
file_size: number;
|
||||
waveform_points?: number[] | null;
|
||||
}
|
||||
|
||||
export interface MediaGroupSendResponse {
|
||||
message: Message;
|
||||
attachments: Array<{
|
||||
id: number;
|
||||
message_id: number;
|
||||
file_url: string;
|
||||
file_type: string;
|
||||
file_size: number;
|
||||
waveform_points?: number[] | null;
|
||||
}>;
|
||||
}
|
||||
|
||||
export async function sendMediaGroupWithClientId(
|
||||
chatId: number,
|
||||
attachments: MediaGroupAttachmentInput[],
|
||||
text: string | null,
|
||||
clientMessageId: string,
|
||||
replyToMessageId?: number
|
||||
): Promise<MediaGroupSendResponse> {
|
||||
const { data } = await http.post<MediaGroupSendResponse>("/messages/media-group", {
|
||||
chat_id: chatId,
|
||||
attachments,
|
||||
text,
|
||||
client_message_id: clientMessageId,
|
||||
reply_to_message_id: replyToMessageId
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
export interface UploadUrlResponse {
|
||||
upload_url: string;
|
||||
file_url: string;
|
||||
|
||||
Reference in New Issue
Block a user