Fix handling attachment thumbnails using thumbnail key
This commit is contained in:
parent
6413e75f82
commit
9ad55c803f
2 changed files with 32 additions and 4 deletions
|
@ -157,8 +157,17 @@ exports._mapQuotedAttachments = upgradeAttachment => async (message, context) =>
|
|||
return message;
|
||||
}
|
||||
|
||||
const upgradeWithContext = attachment =>
|
||||
upgradeAttachment(attachment, context);
|
||||
const upgradeWithContext = async (attachment) => {
|
||||
if (!attachment || !attachment.thumbnail) {
|
||||
return attachment;
|
||||
}
|
||||
|
||||
const thumbnail = await upgradeAttachment(attachment.thumbnail, context);
|
||||
return Object.assign({}, attachment, {
|
||||
thumbnail,
|
||||
});
|
||||
};
|
||||
|
||||
const quotedAttachments = (message.quote && message.quote.attachments) || [];
|
||||
|
||||
const attachments = await Promise.all(quotedAttachments.map(upgradeWithContext));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue