about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--catgirl.12
-rw-r--r--command.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/catgirl.1 b/catgirl.1
index 437b0d1..86bf53d 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -246,6 +246,8 @@ Set or clear your away status.
 Invite a user to the channel.
 .It Ic /join Ar channel
 Join a channel.
+.It Ic /kick Ar nick Op Ar message
+Kick a user from the channel.
 .It Ic /list Op Ar channel
 List channels.
 .It Ic /me Op Ar action
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(&params, " ");
+	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 },
.c?h=1.3&id=907d4b4605a212a645fc78420a29fa34ed9c0642&follow=1'>Exit focus and paste modes on err exitJune McEnroe 2020-02-11Add startup GPLv3 note and URLJune McEnroe 2020-02-11Make sure -D_GNU_SOURCE ends up in CFLAGS on LinuxJune McEnroe 2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe 2020-02-11Rename query ID on nick changeJune McEnroe 2020-02-11Call completeClear when closing a windowJune McEnroe 2020-02-11Don't insert color codes for non-mentionsJune McEnroe 2020-02-11Take first two words in colorMentionsJune McEnroe 2020-02-11Use time_t for save signatureJune McEnroe 2020-02-11Set self.nick to * initiallyJune McEnroe 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe