summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-29 23:49:16 -0500
committerJune McEnroe <june@causal.agency>2020-12-29 23:54:30 -0500
commit1662b01a5f616bd4babc08e1eb6fec1a3c7b44cf (patch)
tree2fba4e960bbd7cac6e55ed96cf4cd6a5f47d9fe7 /command.c
parentHandle so-called Standard Replies (diff)
downloadcatgirl-1662b01a5f616bd4babc08e1eb6fec1a3c7b44cf.tar.gz
catgirl-1662b01a5f616bd4babc08e1eb6fec1a3c7b44cf.zip
Add /setname command
I'm not sure about that replies check in handleStandardReply. If more of
those are added the reply counter system will definitely need
refactoring.
Diffstat (limited to '')
-rw-r--r--command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/command.c b/command.c
index 3af1246..199a561 100644
--- a/command.c
+++ b/command.c
@@ -159,6 +159,13 @@ static void commandAway(uint id, char *params) {
 	replies.away++;
 }
 
+static void commandSetname(uint id, char *params) {
+	(void)id;
+	if (!params) return;
+	ircFormat("SETNAME :%s\r\n", params);
+	replies.setname++;
+}
+
 static void commandTopic(uint id, char *params) {
 	if (params) {
 		ircFormat("TOPIC %s :%s\r\n", idNames[id], params);
@@ -486,6 +493,7 @@ static const struct Handler {
 	{ "/quit", commandQuit, 0 },
 	{ "/quote", commandQuote, Multiline | Restricted },
 	{ "/say", commandPrivmsg, Multiline },
+	{ "/setname", commandSetname, 0 },
 	{ "/topic", commandTopic, 0 },
 	{ "/unban", commandUnban, 0 },
 	{ "/unexcept", commandUnexcept, 0 },