From 0967bb43b4e64e7015f146ed6dcbceddd84580c9 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 14 Jun 2024 17:23:53 +0300 Subject: [PATCH] Avoid passing the whole unsafe display name to the rich text editor for generating mention pill permalinks --- .../RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift index 28cdffbf9a..cfe0f0df3d 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift @@ -431,7 +431,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool } if context.composerFormattingEnabled { - wysiwygViewModel.setMention(url: url.absoluteString, name: item.displayName ?? item.id, mentionType: .user) + wysiwygViewModel.setMention(url: url.absoluteString, name: item.id, mentionType: .user) } else { let attributedString = NSMutableAttributedString(attributedString: state.bindings.plainComposerText) mentionBuilder.handleUserMention(for: attributedString, in: suggestion.range, url: url, userID: item.id, userDisplayName: item.displayName)