summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--command.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/command.c b/command.c
index dfe4850..9047e95 100644
--- a/command.c
+++ b/command.c
@@ -83,6 +83,13 @@ static void commandNick(size_t id, char *params) {
 	ircFormat("NICK :%s\r\n", params);
 }
 
+static void commandQuery(size_t id, char *params) {
+	if (!params) return;
+	size_t query = idFor(params);
+	idColors[query] = completeColor(id, params);
+	uiShowID(query);
+}
+
 static void commandWindow(size_t id, char *params) {
 	if (!params) return;
 	if (isdigit(params[0])) {
@@ -102,6 +109,7 @@ static const struct Handler {
 	{ "/nick", commandNick },
 	{ "/notice", commandNotice },
 	{ "/part", commandPart },
+	{ "/query", commandQuery },
 	{ "/quit", commandQuit },
 	{ "/quote", commandQuote },
 	{ "/window", commandWindow },
@@ -151,6 +159,7 @@ void command(size_t id, char *input) {
 			cmd, Commands, ARRAY_LEN(Commands), sizeof(*handler), compar
 		);
 		if (handler) {
+			if (input && !input[0]) input = NULL;
 			handler->fn(id, input);
 		} else {
 			uiFormat(id, Hot, NULL, "No such command %s", cmd);
=300891077709bba9899f3fdbe5dc4e10308eedd4&follow=1'>Intercept client QUITJune McEnroe 2019-10-24Only set NeedCapEnd if unregisteredJune McEnroe 2019-10-24Set client-side origin to irc.invalidJune McEnroe 2019-10-24Factor out client-side origin nameJune McEnroe 2019-10-24Intercept all CAP commands from clientsJune McEnroe 2019-10-24Ignore further CAP ENDJune McEnroe 2019-10-24Implement client CAP for server-timeJune McEnroe 2019-10-24Implement ringWriteJune McEnroe 2019-10-24Make clientFormat publicJune McEnroe 2019-10-24Make serverFormat publicJune McEnroe 2019-10-24Rename some thingsJune McEnroe 2019-10-23Add ISUPPORT draft to STANDARDSJune McEnroe 2019-10-23Track own originJune McEnroe 2019-10-23Track channels and sync ISUPPORTJune McEnroe 2019-10-23Track nick changesJune McEnroe 2019-10-23Rename Command to MessageJune McEnroe 2019-10-23Synchronize state after client registrationJune McEnroe 2019-10-23Send to server if client has no needsJune McEnroe 2019-10-23Implement some amount of client connectionJune McEnroe 2019-10-23Set clients non-blockingJune McEnroe 2019-10-23Clean up state.c and factor out parsingJune McEnroe 2019-10-23Respond to pingsJune McEnroe 2019-10-23Add verbose flagJune McEnroe 2019-10-23Set NOSIGPIPE on server connectionJune McEnroe 2019-10-23Set an initial loop capJune McEnroe 2019-10-23Fix rest parsingJune McEnroe 2019-10-23Add dynamic poll listJune McEnroe 2019-10-23Don't assume commands have targets and handle ERRORJune McEnroe 2019-10-23Clean up state somewhatJune McEnroe 2019-10-23Actually send the buffer...June McEnroe 2019-10-23Add stateJune McEnroe