Disable removing mention/command text trigger with RTE enabled

This commit is contained in:
aringenbach
2023-05-12 18:30:20 +02:00
parent 16340a18a6
commit 401d6a59cf
+8
View File
@@ -8147,6 +8147,14 @@ static CGSize kThreadListBarButtonItemImageSize;
- (void)removeTriggerTextFromComposer:(NSString *)textTrigger
{
RoomInputToolbarView *toolbar = (RoomInputToolbarView *)self.inputToolbarView;
Class roomInputToolbarViewClass = [RoomViewController mainToolbarClass];
// RTE handles removing the text trigger by itself.
if (roomInputToolbarViewClass == WysiwygInputToolbarView.class && RiotSettings.shared.enableWysiwygTextFormatting)
{
return;
}
if (toolbar && textTrigger.length) {
NSMutableAttributedString *attributedTextMessage = [[NSMutableAttributedString alloc] initWithAttributedString:toolbar.attributedTextMessage];
[[attributedTextMessage mutableString] replaceOccurrencesOfString:textTrigger