From f6420624d191b2d581dccb38cb205490c335d63e Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Thu, 31 Jul 2025 14:17:55 -0400 Subject: [PATCH] chore: disable command parsing (#3602) --- lib/pages/chat/input_bar.dart | 28 ++++++++++--------- .../extensions/room_events_extension.dart | 22 +++++++-------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/lib/pages/chat/input_bar.dart b/lib/pages/chat/input_bar.dart index 05e1fd8b3..e6c056776 100644 --- a/lib/pages/chat/input_bar.dart +++ b/lib/pages/chat/input_bar.dart @@ -66,20 +66,22 @@ class InputBar extends StatelessWidget { final ret = >[]; const maxResults = 30; - final commandMatch = RegExp(r'^/(\w*)$').firstMatch(searchText); - if (commandMatch != null) { - final commandSearch = commandMatch[1]!.toLowerCase(); - for (final command in room.client.commands.keys) { - if (command.contains(commandSearch)) { - ret.add({ - 'type': 'command', - 'name': command, - }); - } + // #Pangea + // final commandMatch = RegExp(r'^/(\w*)$').firstMatch(searchText); + // if (commandMatch != null) { + // final commandSearch = commandMatch[1]!.toLowerCase(); + // for (final command in room.client.commands.keys) { + // if (command.contains(commandSearch)) { + // ret.add({ + // 'type': 'command', + // 'name': command, + // }); + // } - if (ret.length > maxResults) return ret; - } - } + // if (ret.length > maxResults) return ret; + // } + // } + // Pangea# final emojiMatch = RegExp(r'(?:\s|^):(?:([-\w]+)~)?([-\w]+)$').firstMatch(searchText); if (emojiMatch != null) { diff --git a/lib/pangea/extensions/room_events_extension.dart b/lib/pangea/extensions/room_events_extension.dart index 47c7b21a5..65adf4dd2 100644 --- a/lib/pangea/extensions/room_events_extension.dart +++ b/lib/pangea/extensions/room_events_extension.dart @@ -204,17 +204,17 @@ extension EventsRoomExtension on Room { String? messageTag, String? tempEventId, }) { - if (parseCommands) { - return client.parseAndRunCommand( - this, - message, - inReplyTo: inReplyTo, - editEventId: editEventId, - txid: txid, - threadRootEventId: threadRootEventId, - threadLastEventId: threadLastEventId, - ); - } + // if (parseCommands) { + // return client.parseAndRunCommand( + // this, + // message, + // inReplyTo: inReplyTo, + // editEventId: editEventId, + // txid: txid, + // threadRootEventId: threadRootEventId, + // threadLastEventId: threadLastEventId, + // ); + // } final event = { 'msgtype': msgtype,