fix caption for attachments not displayed once sent

This commit is contained in:
audric 2021-08-20 10:20:23 +10:00
parent de1475b3bb
commit 7b93d5df9a
3 changed files with 4 additions and 0 deletions

View File

@ -688,6 +688,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
screenshot,
thumbnail,
fileName,
caption,
} = attachment;
const isVoiceMessage =
@ -696,6 +697,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
return {
id,
contentType,
caption,
size: size || 0,
width: width || 0,
height: height || 0,

View File

@ -136,6 +136,7 @@ export type PropsForSearchResults = {
export type PropsForAttachment = {
id: number;
contentType: string;
caption?: string;
size: number;
width?: number;
height?: number;

View File

@ -109,6 +109,7 @@ export async function getFile(attachment: StagedAttachmentType, maxMeasurements?
const scaled = await autoScale(attachment, maxMeasurements);
const fileRead = await readFile(scaled);
return {
caption: attachment.caption,
...fileRead,
url: undefined,
flags: attachmentFlags || null,