Replace mentions with text when forwarding

This commit is contained in:
Scott Nonnenberg 2022-07-21 09:26:11 -07:00 committed by GitHub
parent 1f65a4491f
commit 026f574fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 4 deletions

View file

@ -38,6 +38,7 @@ import type { EmbeddedContactType } from '../../types/EmbeddedContact';
import { embeddedContactSelector } from '../../types/EmbeddedContact';
import type { AssertProps, BodyRangesType } from '../../types/Util';
import type { LinkPreviewType } from '../../types/message/LinkPreviews';
import { getMentionsRegex } from '../../types/Message';
import { CallMode } from '../../types/Calling';
import { SignalService as Proto } from '../../protobuf';
import type { AttachmentType } from '../../types/Attachment';
@ -705,7 +706,7 @@ function getTextAttachment(
}
export function cleanBodyForDirectionCheck(text: string): string {
const MENTIONS_REGEX = /\uFFFC/g;
const MENTIONS_REGEX = getMentionsRegex();
const EMOJI_REGEX = emojiRegex();
const initial = text.replace(MENTIONS_REGEX, '').replace(EMOJI_REGEX, '');