Display proper text when quoting view once message

This commit is contained in:
Fedor Indutny 2021-06-02 09:42:19 -07:00 committed by GitHub
parent 81227066ce
commit b009967a83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 102 additions and 12 deletions

View file

@ -1243,6 +1243,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
authorUuid,
bodyRanges,
id: sentAt,
isViewOnce,
referencedMessageNotFound,
text,
} = quote;
@ -1342,6 +1343,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
rawAttachment: firstAttachment
? this.processQuoteAttachment(firstAttachment)
: undefined,
isViewOnce,
referencedMessageNotFound: !foundReference,
sentAt: Number(sentAt),
text: this.createNonBreakingLastSeparator(text),
@ -3363,10 +3365,15 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
contentType: 'image/jpeg',
},
];
// eslint-disable-next-line no-param-reassign
quote.isViewOnce = true;
return;
}
// eslint-disable-next-line no-param-reassign
quote.isViewOnce = false;
// eslint-disable-next-line no-param-reassign
quote.text = originalMessage.get('body');
if (firstAttachment) {