chore: disable command parsing (#3602)
This commit is contained in:
parent
7fb42cc980
commit
f6420624d1
2 changed files with 26 additions and 24 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue