summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--handle.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/handle.c b/handle.c
index 6a81380..ed70ce8 100644
--- a/handle.c
+++ b/handle.c
@@ -367,20 +367,46 @@ static void handleQuit(struct Message *msg) {
 	completeRemove(None, msg->nick);
 }
 
-static void handleErrorUserNotInChannel(struct Message *msg) {
-	require(msg, false, 4);
-	uiFormat(
-		idFor(msg->params[2]), Cold, tagTime(msg),
-		"%s\tis not in \3%02d%s\3",
-		msg->params[1], hash(msg->params[2]), msg->params[2]
-	);
+static void handleInvite(struct Message *msg) {
+	require(msg, true, 2);
+	if (!strcmp(msg->params[0], self.nick)) {
+		uiFormat(
+			Network, Hot, tagTime(msg),
+			"\3%02d%s\3\tinvites you to \3%02d%s\3",
+			hash(msg->user), msg->nick, hash(msg->params[1]), msg->params[1]
+		);
+	} else {
+		uiFormat(
+			idFor(msg->params[1]), Cold, tagTime(msg),
+			"\3%02d%s\3\tinvites %s to \3%02d%s\3",
+			hash(msg->user), msg->nick,
+			msg->params[0],
+			hash(msg->params[1]), msg->params[1]
+		);
+	}
 }
 
-static void handleErrorBanListFull(struct Message *msg) {
+static void handleReplyInviting(struct Message *msg) {
+	require(msg, false, 3);
+	if (self.caps & CapInviteNotify) return;
+	struct Message invite = {
+		.nick = self.nick,
+		.user = self.user,
+		.cmd = "INVITE",
+		.params[0] = msg->params[1],
+		.params[1] = msg->params[2],
+	};
+	handleInvite(&invite);
+}
+
+static void handleErrorUserOnChannel(struct Message *msg) {
 	require(msg, false, 4);
+	uint id = idFor(msg->params[2]);
 	uiFormat(
-		idFor(msg->params[1]), Cold, tagTime(msg),
-		"%s", (msg->params[4] ? msg->params[4] : msg->params[3])
+		id, Cold, tagTime(msg),
+		"\3%02d%s\3 is already in \3%02d%s\3",
+		completeColor(id, msg->params[1]), msg->params[1],
+		hash(msg->params[2]), msg->params[2]
 	);
 }
 
@@ -458,6 +484,23 @@ static void handleTopic(struct Message *msg) {
 	}
 }
 
+static void handleErrorUserNotInChannel(struct Message *msg) {
+	require(msg, false, 4);
+	uiFormat(
+		idFor(msg->params[2]), Cold, tagTime(msg),
+		"%s\tis not in \3%02d%s\3",
+		msg->params[1], hash(msg->params[2]), msg->params[2]
+	);
+}
+
+static void handleErrorBanListFull(struct Message *msg) {
+	require(msg, false, 4);
+	uiFormat(
+		idFor(msg->params[1]), Cold, tagTime(msg),
+		"%s", (msg->params[4] ? msg->params[4] : msg->params[3])
+	);
+}
+
 static void handleReplyBanList(struct Message *msg) {
 	require(msg, false, 3);
 	if (!replies.ban) return;
@@ -487,49 +530,6 @@ static void handleReplyEndOfBanList(struct Message *msg) {
 	if (replies.ban) replies.ban--;
 }
 
-static void handleInvite(struct Message *msg) {
-	require(msg, true, 2);
-	if (!strcmp(msg->params[0], self.nick)) {
-		uiFormat(
-			Network, Hot, tagTime(msg),
-			"\3%02d%s\3\tinvites you to \3%02d%s\3",
-			hash(msg->user), msg->nick, hash(msg->params[1]), msg->params[1]
-		);
-	} else {
-		uiFormat(
-			idFor(msg->params[1]), Cold, tagTime(msg),
-			"\3%02d%s\3\tinvites %s to \3%02d%s\3",
-			hash(msg->user), msg->nick,
-			msg->params[0],
-			hash(msg->params[1]), msg->params[1]
-		);
-	}
-}
-
-static void handleReplyInviting(struct Message *msg) {
-	require(msg, false, 3);
-	if (self.caps & CapInviteNotify) return;
-	struct Message invite = {
-		.nick = self.nick,
-		.user = self.user,
-		.cmd = "INVITE",
-		.params[0] = msg->params[1],
-		.params[1] = msg->params[2],
-	};
-	handleInvite(&invite);
-}
-
-static void handleErrorUserOnChannel(struct Message *msg) {
-	require(msg, false, 4);
-	uint id = idFor(msg->params[2]);
-	uiFormat(
-		id, Cold, tagTime(msg),
-		"\3%02d%s\3 is already in \3%02d%s\3",
-		completeColor(id, msg->params[1]), msg->params[1],
-		hash(msg->params[2]), msg->params[2]
-	);
-}
-
 static void handleReplyList(struct Message *msg) {
 	require(msg, false, 4);
 	if (!replies.list) return;
17Add hi -f html -o anchor for line number linksJune McEnroe 2019-02-17Simplify temp trap in upJune McEnroe 2019-02-17Add line numbers to hiJune McEnroe Renames previous -n option to -m to stay consistent with cat -n. Prefixing lines with line numbers affects where the first tab indent ends up relative to the text above it. Not sure if it's worth fixing somehow. 2019-02-17Always split spans after newlinesJune McEnroe Simplifies ANSI and IRC output code, and prepares for line numbered output. 2019-02-15Color format specifiers light cyan in vimJune McEnroe 2019-02-15Highlight Interp as yellowJune McEnroe 2019-02-15Highlight strings in sh command substitutionsJune McEnroe 2019-02-15Add nmap gpJune McEnroe 2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe 2019-02-13Add forgotten "sixth" book of H2G2June McEnroe