From ed52ade7393fafe8e76dad7772c2ebfaf3647119 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Fri, 14 Feb 2020 21:43:27 -0500 Subject: Add /kick --- command.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'command.c') diff --git a/command.c b/command.c index f59176f..3b94270 100644 --- a/command.c +++ b/command.c @@ -141,6 +141,16 @@ static void commandInvite(size_t id, char *params) { ircFormat("INVITE %s %s\r\n", nick, idNames[id]); } +static void commandKick(size_t id, char *params) { + if (!params) return; + char *nick = strsep(¶ms, " "); + if (params) { + ircFormat("KICK %s %s :%s\r\n", idNames[id], nick, params); + } else { + ircFormat("KICK %s %s\r\n", idNames[id], nick); + } +} + static void commandList(size_t id, char *params) { (void)id; if (params) { @@ -259,6 +269,7 @@ static const struct Handler { { "/help", .fn = commandHelp }, { "/invite", .fn = commandInvite }, { "/join", .fn = commandJoin, .restricted = true }, + { "/kick", .fn = commandKick }, { "/list", .fn = commandList }, { "/me", .fn = commandMe }, { "/move", .fn = commandMove }, -- cgit 1.4.1-2-gfad0