about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-08 01:34:55 -0500
committerJune McEnroe <june@causal.agency>2020-02-08 01:34:55 -0500
commit5c10fe0d414b655ae2cbf14c3db9216b438c5193 (patch)
tree835c60e24ae01e9b4648a7996ff5e98542a92b48 /command.c
parentAdd /part (diff)
downloadtest-5c10fe0d414b655ae2cbf14c3db9216b438c5193.tar.gz
test-5c10fe0d414b655ae2cbf14c3db9216b438c5193.zip
Add /query
Diffstat (limited to 'command.c')
-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);
t/home/.shrc?id=dfcb55b3c428fdda52ed9a0a0af4583872cffc1b&follow=1'>Switch gr alias back to git rebaseJune McEnroe 2020-10-27Allow cd host: to cd to same path over sshJune McEnroe 2020-10-27Use SendEnv for cd host:pathJune McEnroe 2020-10-27Allow cd host:path over sshJune McEnroe 2020-10-07Use mandoc -T utf8 for text.June McEnroe 2020-09-20Add The Awakened KingdomJune McEnroe 2020-09-12Move /opt/local back, cheat port select to use system manJune McEnroe 2020-09-12Move /opt/local behind /usr againJune McEnroe 2020-09-12Enable toc in cgit renderings of man pagesJune McEnroe 2020-09-11Install mandoc on macOSJune McEnroe 2020-09-11Rewrite install script yet againJune McEnroe 2020-09-11Remove NetBSD from install scriptJune McEnroe 2020-09-11Use MacPorts rather than pkgsrcJune McEnroe 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe 2020-09-07Add SunglassesJune McEnroe 2020-09-06Add Between the BreathsJune McEnroe 2020-09-04Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe