diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-06-18 08:47:52 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-06-18 08:47:52 +0200 |
commit | 782bc8533666b93f373ad95f81692531470bfc6c (patch) | |
tree | 3ee386bfef6c01b140b304a9b754705ef13a1be7 | |
parent | 5a3b8f8eeea1058c09bfd9fc1ba27db53669fce2 (diff) | |
download | xK-782bc8533666b93f373ad95f81692531470bfc6c.tar.gz xK-782bc8533666b93f373ad95f81692531470bfc6c.tar.xz xK-782bc8533666b93f373ad95f81692531470bfc6c.zip |
degesch: fix /kickban
-rw-r--r-- | degesch.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -6405,10 +6405,16 @@ handle_command_kickban (struct app_context *ctx, char *arguments) "no channel name given and this buffer is not a channel"); else if (*arguments) { - // FIXME: don't include the reason - irc_send (s, "MODE %s +b %s", channel_name, arguments); - // FIXME: the reason should be one argument - irc_send (s, "KICK %s %s", channel_name, arguments); + char *target = cut_word (&arguments); + if (strpbrk (target, "!@*?")) + return false; + + // XXX: how about other masks? + irc_send (s, "MODE %s +b %s!*@*", channel_name, target); + if (*arguments) + irc_send (s, "KICK %s %s :%s", channel_name, target, arguments); + else + irc_send (s, "KICK %s %s", channel_name, target); } else return false; |