summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-14 21:36:58 -0500
committerC. McEnroe2020-02-14 21:36:58 -0500
commit39a343980b634f41377d72426ced50ca8ae0fb64 (patch)
treeaf29e7daa153c7427bfaffcf42ea71bec5b96241 /command.c
parent8aa6dd86f6c7036f6dbc065efb63e1b75e5cf0a8 (diff)
Add /invite
Diffstat (limited to 'command.c')
-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 },