Given the kick message:
```
/kick user123 testing, testing, see if kick messages work
```
The IRC message passed the nick field as:
"user123 testing, testing, see if kick messages work"
which simply did not work at all. Instead, pass only the first word as
the nick, and as a bonus, pass the rest concatenated as the kick reason.
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
lib/commands.dart | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/commands.dart b/lib/commands.dart
index e42eef7..a7fd0fc 100644
--- a/lib/commands.dart+++ b/lib/commands.dart
@@ -32,7 +32,10 @@ String? _kick(BuildContext context, String? param) {
if (!client.isChannel(buffer.name)) {
throw CommandException('This command can only be used in channels');
}
- client.send(IrcMessage('KICK', [buffer.name, _requireParam(param)]));+ var parts = _requireParam(param).split(' ');+ var nick = parts[0];+ var reason = parts.length > 1? parts.sublist(1).join(' ') : '';+ client.send(IrcMessage('KICK', [buffer.name, nick, reason])); return null;
}
--
2.43.2