summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-22 11:26:16 -0400
committerJune McEnroe <june@causal.agency>2020-03-22 11:26:16 -0400
commit61828a12e9651fb672331df400ebd4120673852a (patch)
tree2d20bc122f411acde9a094e0821d76c40792dcca
parentRewrite handleMode (diff)
downloadcatgirl-61828a12e9651fb672331df400ebd4120673852a.tar.gz
catgirl-61828a12e9651fb672331df400ebd4120673852a.zip
Handle user mode changes
-rw-r--r--handle.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/handle.c b/handle.c
index b0f94d4..4392094 100644
--- a/handle.c
+++ b/handle.c
@@ -539,8 +539,25 @@ static const char *ChanModes[256] = {
 
 static void handleMode(struct Message *msg) {
 	require(msg, true, 2);
+
 	if (!strchr(network.chanTypes, msg->params[0][0])) {
-		// TODO: User mode changes.
+		bool set = true;
+		char buf[1024] = "";
+		for (char *ch = msg->params[1]; *ch; ++ch) {
+			if (*ch == '+') { set = true; continue; }
+			if (*ch == '-') { set = false; continue; }
+			const char *name = UserModes[(byte)*ch];
+			if (!name) name = (const char[]) { "-+"[set], *ch, '\0' };
+			catf(
+				buf, sizeof(buf), ", %ssets \3%02d%s\3 %s",
+				(set ? "" : "un"), self.color, msg->params[0], name
+			);
+		}
+		if (!buf[0]) return;
+		uiFormat(
+			Network, Warm, tagTime(msg),
+			"\3%02d%s\3\t%s", hash(msg->user), msg->nick, &buf[2]
+		);
 		return;
 	}
 
title='2020-02-10 21:55:56 -0500'>2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable. 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe Wow. One of the best I've read. 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe Broke out LDLIBS for each bin, and made everything more uniform. 2020-01-28Change scout sensitivity to 1.4June McEnroe idk it seems to work. 2020-01-28Import shows.txtJune McEnroe