diff options
author | C. McEnroe | 2020-02-14 21:10:40 -0500 |
---|---|---|
committer | C. McEnroe | 2020-02-14 21:10:40 -0500 |
commit | 8aa6dd86f6c7036f6dbc065efb63e1b75e5cf0a8 (patch) | |
tree | 29231a93fb4b7083513f42ce58168d5284929575 /command.c | |
parent | 0d23f8f1b8d264e2dce82bd740e376a5731a2478 (diff) |
Add /away
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 11 |
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 }, |