From 782bc8533666b93f373ad95f81692531470bfc6c Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Thu, 18 Jun 2015 08:47:52 +0200
Subject: degesch: fix /kickban
---
degesch.c | 14 ++++++++++----
1 file 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;
--
cgit v1.2.3-70-g09d2