Export long message attachments

This commit is contained in:
trevor-signal 2024-09-23 15:24:41 -04:00 committed by GitHub
parent a9406a7914
commit 511fc9c1a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 423 additions and 82 deletions

View file

@ -6618,7 +6618,8 @@ function getExternalFilesForMessage(message: MessageType): {
externalAttachments: Array<string>;
externalDownloads: Array<string>;
} {
const { attachments, contact, quote, preview, sticker } = message;
const { attachments, bodyAttachment, contact, quote, preview, sticker } =
message;
const externalAttachments: Array<string> = [];
const externalDownloads: Array<string> = [];
@ -6653,6 +6654,16 @@ function getExternalFilesForMessage(message: MessageType): {
}
});
if (bodyAttachment?.path) {
externalAttachments.push(bodyAttachment.path);
}
for (const editHistory of message.editHistory ?? []) {
if (editHistory.bodyAttachment?.path) {
externalAttachments.push(editHistory.bodyAttachment.path);
}
}
if (quote && quote.attachments && quote.attachments.length) {
forEach(quote.attachments, attachment => {
const { thumbnail } = attachment;