about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--handle.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/handle.c b/handle.c
index 4392094..fa3f36b 100644
--- a/handle.c
+++ b/handle.c
@@ -512,13 +512,13 @@ static void handleReplyUserModeIs(struct Message *msg) {
 		if (UserModes[(byte)*ch]) {
 			catf(buf, sizeof(buf), ", %s", UserModes[(byte)*ch]);
 		} else {
-			catf(buf, sizeof(buf), ", mode %c", *ch);
+			catf(buf, sizeof(buf), ", +%c", *ch);
 		}
 	}
 	uiFormat(
 		Network, Warm, tagTime(msg),
-		"\3%02d%s\3\tis%s",
-		self.color, self.nick, (buf[0] ? &buf[1] : buf)
+		"\3%02d%s\3\tis %s",
+		self.color, self.nick, (buf[0] ? &buf[2] : buf)
 	);
 }
 
@@ -537,6 +537,35 @@ static const char *ChanModes[256] = {
 	['v'] = "voice",
 };
 
+static void handleReplyChannelModeIs(struct Message *msg) {
+	require(msg, false, 3);
+	uint param = 3;
+	char buf[1024] = "";
+	for (char *ch = msg->params[2]; *ch; ++ch) {
+		if (*ch == '+') continue;
+		const char *name = ChanModes[(byte)*ch];
+		if (!name) name = (const char[]) { '+', *ch, '\0' };
+		if (
+			strchr(network.paramModes, *ch) ||
+			strchr(network.setParamModes, *ch)
+		) {
+			assert(param < ParamCap);
+			catf(
+				buf, sizeof(buf), ", has %s of %s",
+				name, msg->params[param++]
+			);
+		} else {
+			catf(buf, sizeof(buf), ", is %s", name);
+		}
+	}
+	uiFormat(
+		idFor(msg->params[1]), Cold, tagTime(msg),
+		"\3%02d%s\3\t%s",
+		hash(msg->params[1]), msg->params[1],
+		(buf[0] ? &buf[2] : "has no modes")
+	);
+}
+
 static void handleMode(struct Message *msg) {
 	require(msg, true, 2);
 
@@ -1017,6 +1046,7 @@ static const struct Handler {
 	{ "319", handleReplyWhoisChannels },
 	{ "322", handleReplyList },
 	{ "323", handleReplyListEnd },
+	{ "324", handleReplyChannelModeIs },
 	{ "330", handleReplyWhoisGeneric },
 	{ "331", handleReplyNoTopic },
 	{ "332", handleReplyTopic },
X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 11 is what I use on macOS, but I feel like my eyes are working harder here. 2021-02-07Fully configure and rebind cwmJune McEnroe This is sort of a mix of trying to emulate macOS somewhat for my muscle memory and just rebinding some of the cwm defaults to use 4- rather than M-. 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe cwm still needs a lot more rebinding, and I need to actually look at its other options. xterm definitely still needs some configuration, but I at least managed to get it to use a decent looking font. Very happy that OpenBSD includes Luxi Mono, which is what my usual font, Go Mono, is based on anyway. Still missing is xmodmap and such. 2021-02-06Add xterm output to schemeJune McEnroe