summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-14 21:10:40 -0500
committerJune McEnroe <june@causal.agency>2020-02-14 21:10:40 -0500
commit8aa6dd86f6c7036f6dbc065efb63e1b75e5cf0a8 (patch)
tree29231a93fb4b7083513f42ce58168d5284929575 /command.c
parentSave heat, unreadTotal, unreadWarm (diff)
downloadcatgirl-8aa6dd86f6c7036f6dbc065efb63e1b75e5cf0a8.tar.gz
catgirl-8aa6dd86f6c7036f6dbc065efb63e1b75e5cf0a8.zip
Add /away
Diffstat (limited to 'command.c')
-rw-r--r--command.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/command.c b/command.c
index e0a2e2b..00c3040 100644
--- a/command.c
+++ b/command.c
@@ -110,6 +110,16 @@ static void commandNick(size_t id, char *params) {
 	ircFormat("NICK :%s\r\n", params);
 }
 
+static void commandAway(size_t id, char *params) {
+	(void)id;
+	if (params) {
+		ircFormat("AWAY :%s\r\n", params);
+	} else {
+		ircFormat("AWAY\r\n");
+	}
+	replies.away++;
+}
+
 static void commandTopic(size_t id, char *params) {
 	if (params) {
 		ircFormat("TOPIC %s :%s\r\n", idNames[id], params);
@@ -235,6 +245,7 @@ static const struct Handler {
 	Command *fn;
 	bool restricted;
 } Commands[] = {
+	{ "/away", .fn = commandAway },
 	{ "/close", .fn = commandClose },
 	{ "/copy", .fn = commandCopy, .restricted = true },
 	{ "/debug", .fn = commandDebug, .restricted = true },