Allow sends of quote attachments with no thumbnail
This commit is contained in:
parent
e211837bcd
commit
bedd2c8a15
1 changed files with 8 additions and 4 deletions
|
@ -656,8 +656,9 @@ async function uploadMessageQuote(
|
||||||
}
|
}
|
||||||
|
|
||||||
const uploadedAttachments = await uploadQueue.addAll(
|
const uploadedAttachments = await uploadQueue.addAll(
|
||||||
loadedQuote.attachments.map(
|
loadedQuote.attachments
|
||||||
attachment => async (): Promise<OutgoingQuoteAttachmentType> => {
|
.filter(attachment => attachment.thumbnail)
|
||||||
|
.map(attachment => async (): Promise<OutgoingQuoteAttachmentType> => {
|
||||||
const { thumbnail } = attachment;
|
const { thumbnail } = attachment;
|
||||||
strictAssert(thumbnail, 'Quote attachment must have a thumbnail');
|
strictAssert(thumbnail, 'Quote attachment must have a thumbnail');
|
||||||
|
|
||||||
|
@ -668,8 +669,7 @@ async function uploadMessageQuote(
|
||||||
fileName: attachment.fileName,
|
fileName: attachment.fileName,
|
||||||
thumbnail: uploaded,
|
thumbnail: uploaded,
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update message with attachment digests
|
// Update message with attachment digests
|
||||||
|
@ -680,6 +680,10 @@ async function uploadMessageQuote(
|
||||||
const newQuote = {
|
const newQuote = {
|
||||||
...oldQuote,
|
...oldQuote,
|
||||||
attachments: oldQuote.attachments.map((attachment, index) => {
|
attachments: oldQuote.attachments.map((attachment, index) => {
|
||||||
|
if (!attachment.thumbnail) {
|
||||||
|
return attachment;
|
||||||
|
}
|
||||||
|
|
||||||
strictAssert(
|
strictAssert(
|
||||||
attachment.path === loadedQuote.attachments.at(index)?.path,
|
attachment.path === loadedQuote.attachments.at(index)?.path,
|
||||||
`${logId}: Quote attachment ${index} was updated from under us`
|
`${logId}: Quote attachment ${index} was updated from under us`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue