Skip to content

Commit 24a0cfb

Browse files
Merge pull request #1937 from TheOneWithTheBraid/braid/command-runner
feat: improve commands_extension
2 parents 51b1005 + 86fa1f9 commit 24a0cfb

File tree

4 files changed

+360
-92
lines changed

4 files changed

+360
-92
lines changed

lib/src/client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Client extends MatrixApi {
9898
DateTime? _accessTokenExpiresAt;
9999

100100
// For CommandsClientExtension
101-
final Map<String, FutureOr<String?> Function(CommandArgs)> commands = {};
101+
final Map<String, CommandExecutionCallback> commands = {};
102102
final Filter syncFilter;
103103

104104
final NativeImplementations nativeImplementations;

lib/src/room.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ class Room {
625625
String msgtype = MessageTypes.Text,
626626
String? threadRootEventId,
627627
String? threadLastEventId,
628+
StringBuffer? commandStdout,
628629
}) {
629630
if (parseCommands) {
630631
return client.parseAndRunCommand(
@@ -635,6 +636,7 @@ class Room {
635636
txid: txid,
636637
threadRootEventId: threadRootEventId,
637638
threadLastEventId: threadLastEventId,
639+
stdout: commandStdout,
638640
);
639641
}
640642
final event = <String, dynamic>{

0 commit comments

Comments
 (0)