diff --git a/include/numeric.h b/include/numeric.h index a52b422c4..cbd007a91 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -245,6 +245,7 @@ #define RPL_USERS 393 #define RPL_ENDOFUSERS 394 #define RPL_NOUSERS 395 +#define RPL_HOSTHIDDEN 396 #define RPL_TRACELINK 200 #define RPL_TRACECONNECTING 201 diff --git a/src/modules/m_chghost.c b/src/modules/m_chghost.c index dd7750023..dfa90c50e 100644 --- a/src/modules/m_chghost.c +++ b/src/modules/m_chghost.c @@ -195,6 +195,9 @@ DLLFUNC int m_chghost(aClient *cptr, aClient *sptr, int parc, char *parv[]) acptr->user->virthost = strdup(parv[2]); if (UHOST_ALLOWED == UHALLOW_REJOIN) rejoin_joinandmode(acptr); + + sendto_one(acptr, err_str(RPL_HOSTHIDDEN), me.name, acptr->name, parv[2]); + return 0; } else diff --git a/src/modules/m_mode.c b/src/modules/m_mode.c index e47d2e96f..b45c6d0c4 100644 --- a/src/modules/m_mode.c +++ b/src/modules/m_mode.c @@ -1805,6 +1805,7 @@ DLLFUNC CMD_FUNC(_m_umode) if (MyClient(sptr)) sptr->since += 7; /* Add fake lag */ } + sendto_one(sptr, err_str(RPL_HOSTHIDDEN), me.name, sptr->name, sptr->user->virthost); } if (!IsHidden(sptr) && (setflags & UMODE_HIDE)) @@ -1829,6 +1830,7 @@ DLLFUNC CMD_FUNC(_m_umode) * been a vhost for example. -- Syzop */ sptr->user->virthost = strdup(sptr->user->cloakedhost); + sendto_one(sptr, err_str(RPL_HOSTHIDDEN), me.name, sptr->name, sptr->user->realhost); } /* * If I understand what this code is doing correctly... diff --git a/src/modules/m_nick.c b/src/modules/m_nick.c index 660f1177c..4b41da8f6 100644 --- a/src/modules/m_nick.c +++ b/src/modules/m_nick.c @@ -1374,6 +1374,9 @@ int _register_user(aClient *cptr, aClient *sptr, char *nick, char *username, cha sendto_one(sptr, rpl_str(RPL_YOURID), me.name, nick, sptr->id); + if (IsHidden(sptr)) + sendto_one(sptr, err_str(RPL_HOSTHIDDEN), me.name, sptr->name, user->virthost); + if (sptr->flags & FLAGS_SSL) if (sptr->ssl) sendto_one(sptr, diff --git a/src/modules/m_sethost.c b/src/modules/m_sethost.c index 9cd00d056..abafbf714 100644 --- a/src/modules/m_sethost.c +++ b/src/modules/m_sethost.c @@ -227,6 +227,7 @@ DLLFUNC int m_sethost(aClient *cptr, aClient *sptr, int parc, char *parv[]) if (MyConnect(sptr)) { sendto_one(sptr, ":%s MODE %s :+xt", sptr->name, sptr->name); + sendto_one(sptr, err_str(RPL_HOSTHIDDEN), me.name, sptr->name, vhost); sendto_one(sptr, ":%s NOTICE %s :Your nick!user@host-mask is now (%s!%s@%s) - To disable it type /mode %s -x", me.name, parv[0], parv[0], sptr->user->username, vhost, diff --git a/src/modules/m_vhost.c b/src/modules/m_vhost.c index 76fb6942d..82c3eb092 100644 --- a/src/modules/m_vhost.c +++ b/src/modules/m_vhost.c @@ -180,6 +180,7 @@ int m_vhost(aClient *cptr, aClient *sptr, int parc, char *parv[]) sendto_server(cptr, 0, 0, ":%s SWHOIS %s :%s", me.name, sptr->name, vhost->swhois); } + sendto_one(sptr, err_str(RPL_HOSTHIDDEN), me.name, sptr->name, vhost->virthost); sendto_one(sptr, ":%s NOTICE %s :*** Your vhost is now %s%s%s", me.name, sptr->name, vhost->virtuser ? vhost->virtuser : "", diff --git a/src/s_err.c b/src/s_err.c index 087ec4562..0e1c67bb8 100644 --- a/src/s_err.c +++ b/src/s_err.c @@ -440,7 +440,7 @@ static char *replies[] = { /* 394 */ NULL, /* 395 */ NULL, #endif -/* 396 */ NULL, /* ircu */ +/* 396 RPL_HOSTHIDDEN */ ":%s 396 %s %s :is now your displayed host", /* 397 */ NULL, /* 398 */ NULL, /* 399 */ NULL, diff --git a/src/s_user.c b/src/s_user.c index cf6327a34..55dfeda78 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -82,6 +82,8 @@ void iNAH_host(aClient *sptr, char *host) if (UHOST_ALLOWED == UHALLOW_REJOIN) rejoin_joinandmode(sptr); + + sendto_one(sptr, err_str(RPL_HOSTHIDDEN), me.name, sptr->name, sptr->user->virthost); } long set_usermode(char *umode)