diff --git a/ts/models/message.ts b/ts/models/message.ts index 5c46114233..72a43caaa5 100644 --- a/ts/models/message.ts +++ b/ts/models/message.ts @@ -688,6 +688,7 @@ export class MessageModel extends Backbone.Model { screenshot, thumbnail, fileName, + caption, } = attachment; const isVoiceMessage = @@ -696,6 +697,7 @@ export class MessageModel extends Backbone.Model { return { id, contentType, + caption, size: size || 0, width: width || 0, height: height || 0, diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 73b26fcb1b..81f1580f0a 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -136,6 +136,7 @@ export type PropsForSearchResults = { export type PropsForAttachment = { id: number; contentType: string; + caption?: string; size: number; width?: number; height?: number; diff --git a/ts/util/attachmentsUtil.ts b/ts/util/attachmentsUtil.ts index 1871ef31cb..a3c5ea9dd4 100644 --- a/ts/util/attachmentsUtil.ts +++ b/ts/util/attachmentsUtil.ts @@ -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,