about summary refs log tree commit diff
path: root/input.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-05 14:53:16 -0500
committerJune McEnroe <june@causal.agency>2018-12-05 14:53:16 -0500
commit0d165fadfaa060328aa78843ee0e6e27c24534e6 (patch)
treee2c67f4932ab1bf8af329173dbaef71332d467a3 /input.c
parentRename verbose to raw (diff)
downloadcatgirl-0d165fadfaa060328aa78843ee0e6e27c24534e6.tar.gz
catgirl-0d165fadfaa060328aa78843ee0e6e27c24534e6.zip
Send input errors to the current tag
Diffstat (limited to '')
-rw-r--r--input.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/input.c b/input.c
index a358993..4814841 100644
--- a/input.c
+++ b/input.c
@@ -39,10 +39,11 @@ static void privmsg(struct Tag tag, bool action, const char *mesg) {
 	free(line);
 }
 
-static char *param(const char *command, char **params, const char *name) {
+static char *
+param(struct Tag tag, const char *command, char **params, const char *name) {
 	char *param = strsep(params, " ");
 	if (param) return param;
-	uiFmt(TagStatus, UIHot, "%s requires a %s", command, name);
+	uiFmt(tag, UIHot, "%s requires a %s", command, name);
 	return NULL;
 }
 
@@ -54,14 +55,14 @@ static void inputMe(struct Tag tag, char *params) {
 
 static void inputNick(struct Tag tag, char *params) {
 	(void)tag;
-	char *nick = param("/nick", &params, "name");
+	char *nick = param(tag, "/nick", &params, "name");
 	if (!nick) return;
 	ircFmt("NICK %s\r\n", nick);
 }
 
 static void inputJoin(struct Tag tag, char *params) {
 	(void)tag;
-	char *chan = param("/join", &params, "channel");
+	char *chan = param(tag, "/join", &params, "channel");
 	if (!chan) return;
 	ircFmt("JOIN %s\r\n", chan);
 }
@@ -76,7 +77,7 @@ static void inputPart(struct Tag tag, char *params) {
 
 static void inputQuery(struct Tag tag, char *params) {
 	(void)tag;
-	char *nick = param("/query", &params, "nick");
+	char *nick = param(tag, "/query", &params, "nick");
 	if (!nick) return;
 	tabTouch(TagNone, nick);
 	uiViewTag(tagFor(nick));
@@ -90,7 +91,7 @@ static void inputWho(struct Tag tag, char *params) {
 
 static void inputWhois(struct Tag tag, char *params) {
 	(void)tag;
-	char *nick = param("/whois", &params, "nick");
+	char *nick = param(tag, "/whois", &params, "nick");
 	if (!nick) return;
 	ircFmt("WHOIS %s\r\n", nick);
 }
@@ -125,7 +126,7 @@ static void inputOpen(struct Tag tag, char *params) {
 
 static void inputView(struct Tag tag, char *params) {
 	(void)tag;
-	char *view = param("/view", &params, "name or number");
+	char *view = param(tag, "/view", &params, "name or number");
 	if (!view) return;
 	int num = strtol(view, &view, 0);
 	if (!view[0]) {
@@ -135,7 +136,7 @@ static void inputView(struct Tag tag, char *params) {
 		if (tag.id != TagNone.id) {
 			uiViewTag(tag);
 		} else {
-			uiFmt(TagStatus, UIHot, "No view for %s", view);
+			uiFmt(tag, UIHot, "No view for %s", view);
 		}
 	}
 }
@@ -216,7 +217,7 @@ void input(struct Tag tag, char *input) {
 		Commands[i].handler(tag, input);
 		return;
 	}
-	uiFmt(TagStatus, UIHot, "%s isn't a recognized command", command);
+	uiFmt(tag, UICold, "%s isn't a recognized command", command);
 }
 
 void inputTab(void) {
' class='logmsg'> 2020-02-11Support monochromatic terminalsJune McEnroe Oops, division by zero! 2020-02-11Add .gz to chroot-man scriptJune McEnroe 2020-02-11Add -R restricted flagJune McEnroe 2020-02-11Add chroot targetJune McEnroe 2020-02-11Exit focus and paste modes on err exitJune McEnroe 2020-02-11Add startup GPLv3 note and URLJune McEnroe I am a degenerate. 2020-02-11Make sure -D_GNU_SOURCE ends up in CFLAGS on LinuxJune McEnroe 2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe 2020-02-11Rename query ID on nick changeJune McEnroe 2020-02-11Call completeClear when closing a windowJune McEnroe 2020-02-11Don't insert color codes for non-mentionsJune McEnroe 2020-02-11Take first two words in colorMentionsJune McEnroe This lets phrases like "hi june" get colored, but still doesn't get carried away. 2020-02-11Use time_t for save signatureJune McEnroe It's actually more likely to be 64-bit than size_t anyway, and it eliminates some helper functions. Also don't error when reading an empty save file. 2020-02-11Set self.nick to * initiallyJune McEnroe Allows removing a bunch of checks that self.nick is set, and it's what the server usually calls you before registration. Never highlight notices as mentions. 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe Rookie mistake. 2020-02-11Cast towupper to wchar_tJune McEnroe For some reason it takes and returns wint_t... 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe