mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 03:43:27 +01:00
Support for receiving formatted messages
Co-authored-by: Alvaro Carrasco <alvaro@signal.org>
This commit is contained in:
@@ -33,9 +33,10 @@ import {
|
||||
import { useGlobalModalActions } from '../ducks/globalModals';
|
||||
import { useLinkPreviewActions } from '../ducks/linkPreviews';
|
||||
import { processBodyRanges } from '../selectors/message';
|
||||
import { getTextWithMentions } from '../../util/getTextWithMentions';
|
||||
import { SmartCompositionTextArea } from './CompositionTextArea';
|
||||
import { useToastActions } from '../ducks/toast';
|
||||
import type { HydratedBodyRangeMention } from '../../types/BodyRange';
|
||||
import { applyRangesForText, BodyRange } from '../../types/BodyRange';
|
||||
|
||||
function renderMentions(
|
||||
message: ForwardMessagePropsType,
|
||||
@@ -52,7 +53,13 @@ function renderMentions(
|
||||
});
|
||||
|
||||
if (bodyRanges && bodyRanges.length) {
|
||||
return getTextWithMentions(bodyRanges, text);
|
||||
return applyRangesForText({
|
||||
mentions: bodyRanges.filter<HydratedBodyRangeMention>(
|
||||
BodyRange.isMention
|
||||
),
|
||||
spoilers: [],
|
||||
text,
|
||||
});
|
||||
}
|
||||
|
||||
return text;
|
||||
|
||||
Reference in New Issue
Block a user