Render quoted mentions as text

This commit is contained in:
Josh Perez 2020-09-18 17:43:57 -04:00 committed by Josh Perez
parent bc3b61db1d
commit 2d5292b2f3
7 changed files with 26 additions and 32 deletions

View file

@ -41,7 +41,7 @@
savePackMetadata,
getStickerPackStatus,
} = window.Signal.Stickers;
const { GoogleChrome } = window.Signal.Util;
const { GoogleChrome, getTextWithMentions } = window.Signal.Util;
const { addStickerPackReference, getMessageBySender } = window.Signal.Data;
const { bytesFromString } = window.Signal.Crypto;
@ -696,14 +696,6 @@
);
},
getTextWithMentionStrings(bodyRanges, text) {
return bodyRanges.reduce((str, range) => {
const textBegin = str.substr(0, range.start);
const textEnd = str.substr(range.start + range.length, str.length);
return `${textBegin}@${range.replacementText}${textEnd}`;
}, text);
},
// Dependencies of prop-generation functions
findAndFormatContact(identifier) {
if (!identifier) {
@ -1215,7 +1207,7 @@
if (hasMentions) {
const bodyRanges = this.processBodyRanges();
modifiedText = this.getTextWithMentionStrings(bodyRanges, modifiedText);
modifiedText = getTextWithMentions(bodyRanges, modifiedText);
}
// Linux emoji support is mixed, so we disable it. (Note that this doesn't touch