summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--handle.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/handle.c b/handle.c
index 4b15517..f374e36 100644
--- a/handle.c
+++ b/handle.c
@@ -496,6 +496,32 @@ static void handleTopic(struct Message *msg) {
 	}
 }
 
+static const char *UserModes[256] = {
+	['O'] = "local oper",
+	['i'] = "invisible",
+	['o'] = "oper",
+	['r'] = "registered",
+	['w'] = "wallops",
+};
+
+static void handleReplyUserModeIs(struct Message *msg) {
+	require(msg, false, 2);
+	char buf[1024] = "";
+	for (char *ch = msg->params[1]; *ch; ++ch) {
+		if (*ch == '+') continue;
+		if (UserModes[(byte)*ch]) {
+			catf(buf, sizeof(buf), ", %s", UserModes[(byte)*ch]);
+		} else {
+			catf(buf, sizeof(buf), ", mode %c", *ch);
+		}
+	}
+	uiFormat(
+		Network, Warm, tagTime(msg),
+		"\3%02d%s\3\tis%s",
+		self.color, self.nick, (buf[0] ? &buf[1] : buf)
+	);
+}
+
 static const char *ModeNames[256] = {
 	['i'] = "invite-only",
 	['k'] = "key",
@@ -960,6 +986,7 @@ static const struct Handler {
 } Handlers[] = {
 	{ "001", handleReplyWelcome },
 	{ "005", handleReplyISupport },
+	{ "221", handleReplyUserModeIs },
 	{ "276", handleReplyWhoisGeneric },
 	{ "301", handleReplyAway },
 	{ "305", handleReplyNowAway },
ect'>Add -a flag to xxJune McEnroe 2016-09-12Add -o flag to xxJune McEnroe 2016-09-12Add -g option to xxJune McEnroe 2016-09-12Add -c option to xxJune McEnroe 2016-09-12Add .bin/xx.cJune McEnroe 2016-09-08Rename colorscheme to lameJune McEnroe 2016-09-04Simplify colors syntax in zsh promptJune McEnroe 2016-08-29Color rubyStringDelimiter as StringJune McEnroe 2016-08-24Highlight rubyDefine as StructureJune McEnroe 2016-08-23Remove scroll bindings from nvim configJune McEnroe 2016-08-17Highlight Search with black foregroundJune McEnroe 2016-08-15Remove gruvboxJune McEnroe 2016-08-04Remove march from SSH configJune McEnroe 2016-08-01Disable tab indicators in iTermJune McEnroe 2016-07-30Color PreProc DarkGreenJune McEnroe 2016-07-29Color Structure and Typedef in grayJune McEnroe 2016-07-27Color comments DarkBlue and LightBlueJune McEnroe 2016-07-27Color macros in yellowJune McEnroe 2016-07-26Colorscheme colors and schemesJune McEnroe 2016-07-26Add ''subtle'' colorschemeJune McEnroe I'm just trying this out. 2016-07-26Add htoprcJune McEnroe 2016-07-24Add may and refactor ssh configJune McEnroe 2016-07-18Disable cursorlineJune McEnroe 2016-07-18Use hard constrast gruvbox darkJune McEnroe 2016-07-15Remove vim configurationJune McEnroe 2016-07-15Add readline to README configurations listJune McEnroe 2016-07-15Add vendor script to READMEJune McEnroe 2016-07-15Pull latest pathogen and gruvboxJune McEnroe