fix: make sure we include width and height when sending attachments

This commit is contained in:
Audric Ackermann 2022-09-01 13:31:59 +10:00
parent b06944fc4b
commit dcf9212b07
3 changed files with 6 additions and 0 deletions

View file

@ -56,6 +56,8 @@ async function uploadToFileServer(params: UploadParams): Promise<AttachmentPoint
fileName: attachment.fileName,
flags: attachment.flags,
caption: attachment.caption,
width: attachment.width,
height: attachment.height,
};
let attachmentData: ArrayBuffer;

View file

@ -36,6 +36,8 @@ async function uploadV3(params: UploadParamsV2): Promise<AttachmentPointerWithUr
fileName: attachment.fileName,
flags: attachment.flags,
caption: attachment.caption,
width: attachment.width && isFinite(attachment.width) ? attachment.width : undefined,
height: attachment.height && isFinite(attachment.height) ? attachment.height : undefined,
};
const paddedAttachment: ArrayBuffer = !openGroup

View file

@ -264,6 +264,8 @@ export type Attachment = {
flags?: SignalService.AttachmentPointer.Flags;
contentType?: MIME.MIMEType;
size?: number;
width?: number;
height?: number;
data: ArrayBuffer;
} & Partial<AttachmentSchemaVersion3>;