summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-04 21:25:59 -0500
committerJune McEnroe <june@causal.agency>2021-02-04 21:25:59 -0500
commit180287164cec8cfec02c564e67a9bfa5cd5a58e9 (patch)
tree6a50e157bbac7a61e7a3ab0b6c33fc30d0622a45
parentAdd C-z C-v for literal next (diff)
downloadcatgirl-180287164cec8cfec02c564e67a9bfa5cd5a58e9.tar.gz
catgirl-180287164cec8cfec02c564e67a9bfa5cd5a58e9.zip
Only treat a single -j join as explicit
In other words, only automatically switch to an automatically joined
channel window if there's only one. Otherwise, stay on the <network>
window and avoid touching the channel windows with their automatic
topic and names replies.

This fixes unintentionally clearing saved window unread counts when
rejoining channels automatically by switching to them as they are
joined.
-rw-r--r--handle.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/handle.c b/handle.c
index c3faa05..44001bb 100644
--- a/handle.c
+++ b/handle.c
@@ -239,14 +239,12 @@ static void handleReplyWelcome(struct Message *msg) {
 	set(&self.nick, msg->params[0]);
 	completeTouch(Network, self.nick, Default);
 	if (self.join) {
-		uint count = 1;
-		for (const char *ch = self.join; *ch && *ch != ' '; ++ch) {
-			if (*ch == ',') count++;
-		}
 		ircFormat("JOIN %s\r\n", self.join);
-		replies[ReplyJoin] += count;
-		replies[ReplyTopic] += count;
-		replies[ReplyNames] += count;
+		if (!strchr(self.join, ',')) {
+			replies[ReplyJoin]++;
+			replies[ReplyTopic]++;
+			replies[ReplyNames]++;
+		}
 	}
 }
 
low=1'>Set PS0 in cashJune McEnroe 2019-01-13Add PS0June McEnroe 2019-01-13Change default ENV from cashrc to env.shJune McEnroe 2019-01-13Use colours in cash promptsJune McEnroe 2019-01-12Set PSlit like NetBSD shJune McEnroe 2019-01-12Install gnupg2 from pkgsrc and symlink gpgJune McEnroe 2019-01-12Reference cash builtin man pages in cash.1 SEE ALSOJune McEnroe 2019-01-12Restore cash builtin man page datesJune McEnroe 2019-01-12Use local libeditJune McEnroe 2019-01-12Replace libedit MakefileJune McEnroe 2019-01-11Import /usr/src/lib/libedit from NetBSD 8.0June McEnroe 2019-01-11Add PSlit for prompt escapesJune McEnroe 2019-01-11Don't make depend automaticallyJune McEnroe