summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-10 20:24:07 -0500
committerJune McEnroe <june@causal.agency>2020-02-10 20:24:07 -0500
commit80a79467efca8f17e440cb63009c60dd8e78cc63 (patch)
tree96c3e7e1bb3c3f1fad88976fc359307688f75f13
parentDelegate to commandPrivmsg from commandMsg (diff)
downloadcatgirl-80a79467efca8f17e440cb63009c60dd8e78cc63.tar.gz
catgirl-80a79467efca8f17e440cb63009c60dd8e78cc63.zip
Only automatically switch to expected joins
-rw-r--r--chat.h1
-rw-r--r--command.c1
-rw-r--r--handle.c6
3 files changed, 7 insertions, 1 deletions
diff --git a/chat.h b/chat.h
index 03a0a50..f47b244 100644
--- a/chat.h
+++ b/chat.h
@@ -120,6 +120,7 @@ void ircFormat(const char *format, ...)
 	__attribute__((format(printf, 1, 2)));
 
 extern struct Replies {
+	size_t join;
 	size_t topic;
 	size_t names;
 	size_t whois;
diff --git a/command.c b/command.c
index cab1d26..5cb43cf 100644
--- a/command.c
+++ b/command.c
@@ -86,6 +86,7 @@ static void commandJoin(size_t id, char *params) {
 		}
 	}
 	ircFormat("JOIN %s\r\n", (params ? params : idNames[id]));
+	replies.join += count;
 	replies.topic += count;
 	replies.names += count;
 }
diff --git a/handle.c b/handle.c
index fd2a67f..0db7fd9 100644
--- a/handle.c
+++ b/handle.c
@@ -164,6 +164,7 @@ static void handleReplyWelcome(struct Message *msg) {
 			if (*ch == ',') count++;
 		}
 		ircFormat("JOIN %s\r\n", self.join);
+		replies.join += count;
 		replies.topic += count;
 		replies.names += count;
 	}
@@ -211,7 +212,10 @@ static void handleJoin(struct Message *msg) {
 		}
 		idColors[id] = hash(msg->params[0]);
 		completeTouch(None, msg->params[0], idColors[id]);
-		uiShowID(id);
+		if (replies.join) {
+			uiShowID(id);
+			replies.join--;
+		}
 	}
 	completeTouch(id, msg->nick, hash(msg->user));
 	if (msg->params[2] && !strcasecmp(msg->params[2], msg->nick)) {
ctor out window management to window.cJune McEnroe 2022-02-19Enable -Wmissing-prototypesJune McEnroe In other words, warn when a function is missing static. I don't see why this isn't in -Wextra. 2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe 2022-02-19Run line editing testsJune McEnroe I know, it feels wrong. 2022-02-18Implement new line editing "library"June McEnroe Losing tab complete and text macros, for now. This new implementation works on an instance of a struct and does not interact with the rest of catgirl, making it possible to copy into another project. Unlike existing line editing libraries, this one is entirely abstract and can be rendered externally. My goal with this library is to be able to implement vi mode. Since it operates on struct instances rather than globals, it might also be possible to give catgirl separate line editing buffers for each window, which would be a nice UX improvement. 2022-02-18Simplify cursor positioning in inputJune McEnroe Do some extra work by adding the portion before the cursor to the input window twice, but simplify the interaction with the split point. This fixes the awkward behaviour when moving the cursor across colour codes where the code would be partially interpreted up to the cursor. 2022-02-18Fix M-f orderingJune McEnroe 2022-02-12Move sandman build to scripts/MakefileJune McEnroe 2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe 2022-02-12Copy RPP defines from oconfigureJune McEnroe