chore: disable command parsing (#3602)

This commit is contained in:
ggurdin 2025-07-31 14:17:55 -04:00 committed by GitHub
parent 7fb42cc980
commit f6420624d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 24 deletions

View file

@ -66,20 +66,22 @@ class InputBar extends StatelessWidget {
final ret = <Map<String, String?>>[];
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) {

View file

@ -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 = <String, dynamic>{
'msgtype': msgtype,