aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-18 08:47:52 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-18 08:47:52 +0200
commit782bc8533666b93f373ad95f81692531470bfc6c (patch)
tree3ee386bfef6c01b140b304a9b754705ef13a1be7
parent5a3b8f8eeea1058c09bfd9fc1ba27db53669fce2 (diff)
downloadxK-782bc8533666b93f373ad95f81692531470bfc6c.tar.gz
xK-782bc8533666b93f373ad95f81692531470bfc6c.tar.xz
xK-782bc8533666b93f373ad95f81692531470bfc6c.zip
degesch: fix /kickban
-rw-r--r--degesch.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/degesch.c b/degesch.c
index 5ead3a4..5ad27fb 100644
--- a/degesch.c
+++ b/degesch.c
@@ -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;