about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-14 21:36:58 -0500
committerJune McEnroe <june@causal.agency>2020-02-14 21:36:58 -0500
commit39a343980b634f41377d72426ced50ca8ae0fb64 (patch)
treeaf29e7daa153c7427bfaffcf42ea71bec5b96241 /command.c
parentAdd /away (diff)
downloadcatgirl-39a343980b634f41377d72426ced50ca8ae0fb64.tar.gz
catgirl-39a343980b634f41377d72426ced50ca8ae0fb64.zip
Add /invite
Diffstat (limited to '')
-rw-r--r--command.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/command.c b/command.c
index 00c3040..f59176f 100644
--- a/command.c
+++ b/command.c
@@ -135,6 +135,12 @@ static void commandNames(size_t id, char *params) {
 	replies.names++;
 }
 
+static void commandInvite(size_t id, char *params) {
+	if (!params) return;
+	char *nick = strsep(&params, " ");
+	ircFormat("INVITE %s %s\r\n", nick, idNames[id]);
+}
+
 static void commandList(size_t id, char *params) {
 	(void)id;
 	if (params) {
@@ -251,6 +257,7 @@ static const struct Handler {
 	{ "/debug", .fn = commandDebug, .restricted = true },
 	{ "/exec", .fn = commandExec, .restricted = true },
 	{ "/help", .fn = commandHelp },
+	{ "/invite", .fn = commandInvite },
 	{ "/join", .fn = commandJoin, .restricted = true },
 	{ "/list", .fn = commandList },
 	{ "/me", .fn = commandMe },