summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--handle.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/handle.c b/handle.c
index d8f5f3d..b648840 100644
--- a/handle.c
+++ b/handle.c
@@ -97,10 +97,6 @@ typedef void Handler(struct Message *msg);
 
 static void handleStandardReply(struct Message *msg) {
 	require(msg, false, 3);
-	if (!strcmp(msg->params[0], "SETNAME")) {
-		if (!replies.setname) return;
-		replies.setname--;
-	}
 	for (uint i = 2; i < ParamCap - 1; ++i) {
 		if (msg->params[i + 1]) continue;
 		uiFormat(
@@ -446,6 +442,18 @@ static void handleNick(struct Message *msg) {
 	completeReplace(None, msg->nick, msg->params[0]);
 }
 
+static void handleSetname(struct Message *msg) {
+	require(msg, true, 1);
+	for (uint id; (id = completeID(msg->nick));) {
+		uiFormat(
+			id, ignoreCheck(Cold, id, msg), tagTime(msg),
+			"\3%02d%s\3\tis now known as \3%02d%s\3 (%s)",
+			hash(msg->user), msg->nick, hash(msg->user), msg->nick,
+			msg->params[0]
+		);
+	}
+}
+
 static void handleQuit(struct Message *msg) {
 	require(msg, true, 0);
 	for (uint id; (id = completeID(msg->nick));) {
@@ -1154,17 +1162,6 @@ static void handleReplyNowAway(struct Message *msg) {
 	replies.away--;
 }
 
-static void handleSetname(struct Message *msg) {
-	require(msg, true, 1);
-	if (!replies.setname) return;
-	if (strcmp(msg->nick, self.nick)) return;
-	uiFormat(
-		Network, Warm, tagTime(msg),
-		"You update your name tag: %s", msg->params[0]
-	);
-	replies.setname--;
-}
-
 static bool isAction(struct Message *msg) {
 	if (strncmp(msg->params[1], "\1ACTION ", 8)) return false;
 	msg->params[1] += 8;