Show setnames like nick changes

master
C. McEnroe 2020-12-30 00:15:11 -05:00
parent 1662b01a5f
commit 05fbcb41c9
4 changed files with 14 additions and 18 deletions

View File

@ -187,7 +187,8 @@ The commands which can be filtered are:
.Sy NOTICE ,
.Sy PART ,
.Sy PRIVMSG ,
.Sy QUIT .
.Sy QUIT ,
.Sy SETNAME .
.
.It Fl j Ar join , Cm join = Ar join
Join the comma-separated list of channels

1
chat.h
View File

@ -257,7 +257,6 @@ extern struct Replies {
uint list;
uint mode;
uint names;
uint setname;
uint topic;
uint who;
uint whois;

View File

@ -163,7 +163,6 @@ static void commandSetname(uint id, char *params) {
(void)id;
if (!params) return;
ircFormat("SETNAME :%s\r\n", params);
replies.setname++;
}
static void commandTopic(uint id, char *params) {

View File

@ -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;