From 8aa6dd86f6c7036f6dbc065efb63e1b75e5cf0a8 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 14 Feb 2020 21:10:40 -0500 Subject: Add /away --- command.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'command.c') 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 }, -- cgit 1.4.1