Send attachment filenames for non-image/non-video quote attachments

This commit is contained in:
Scott Nonnenberg 2024-01-26 16:21:01 -08:00 committed by GitHub
parent 95c3694c6e
commit fd187a353c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 11 deletions

View file

@ -793,6 +793,7 @@ async function uploadMessageQuote({
if (!thumbnail) {
return {
contentType: attachment.contentType,
fileName: attachment.fileName,
};
}

View file

@ -50,7 +50,6 @@ import * as reactionUtil from '../reactions/util';
import * as Errors from '../types/errors';
import type { AttachmentType } from '../types/Attachment';
import { isImage, isVideo } from '../types/Attachment';
import { stringToMIMEType } from '../types/MIME';
import * as MIME from '../types/MIME';
import { ReadStatus } from '../messages/MessageReadStatus';
import type { SendStateByConversationId } from '../messages/MessageSendState';
@ -1553,16 +1552,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
firstAttachment.thumbnail = null;
}
if (
!firstAttachment ||
!firstAttachment.contentType ||
(!GoogleChrome.isImageTypeSupported(
stringToMIMEType(firstAttachment.contentType)
) &&
!GoogleChrome.isVideoTypeSupported(
stringToMIMEType(firstAttachment.contentType)
))
) {
if (!firstAttachment || !firstAttachment.contentType) {
return;
}
@ -1599,6 +1589,10 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
...thumbnail,
copied: true,
};
} else {
firstAttachment.contentType = queryFirst.contentType;
firstAttachment.fileName = queryFirst.fileName;
firstAttachment.thumbnail = null;
}
}