From: Egor Date: Fri, 27 Oct 2023 21:27:09 +0000 (+0300) Subject: add RPL_VISIBLEHOST X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=0ea5ce627d56b4697e950519c7cdbe6e4c51fd87;p=patchyircd.git add RPL_VISIBLEHOST --- diff --git a/src/irc.c b/src/irc.c index 72e02fb..258478e 100644 --- a/src/irc.c +++ b/src/irc.c @@ -1329,6 +1329,7 @@ void client_chghost(struct client_data *client, const char *newusername, const c sendbuf_monitor(client->key, cookie, CAP_CHGHOST|CAP_EXTENDEDMONITOR, 0); if (client->cookie != cookie) sendbuf(client); + rpl_visiblehost(client), sendbuf(client); int changedacc = client->username[0] != '~' || newusername[0] != '~'; free(client->username); client->username = mystrdup(newusername); diff --git a/src/ircfmt.c b/src/ircfmt.c index 5a1457d..9a8aed7 100644 --- a/src/ircfmt.c +++ b/src/ircfmt.c @@ -532,6 +532,10 @@ void rpl_time(struct client_data *client, time_t ts) // 391 buf[24] = '\0'; copy_strf(&databuf, ":%s 391 %s %s :%s\r\n", hostname, client->nick, ts, buf); } +void rpl_visiblehost(struct client_data *client) // 396 +{ + copy_strf(&databuf, ":%s 396 %s %s@%s :is now you visible host\r\n", hostname, client->nick, client->username, client->hostname); +} #if 0 void err_unknownerror(struct client_data *client, const char *command, const char *msg) // 400 { diff --git a/src/ircfmt.h b/src/ircfmt.h index 2b0f285..0163421 100644 --- a/src/ircfmt.h +++ b/src/ircfmt.h @@ -95,6 +95,7 @@ void rpl_whoismodes(struct client_data *client, struct client_data *cl); // 379 void rpl_youreoper(struct client_data *client); // 381 // 382 RPL_REHASHING void rpl_time(struct client_data *client, time_t ts); // 391 +void rpl_visiblehost(struct client_data *client); // 396 void err_unknownerror(struct client_data *client, const char *command, const char *msg); // 400 void err_nosuchnick(struct client_data *client, const char *nick); // 401 void err_nosuchserver(struct client_data *client, const char *server); // 402