Skip to content

Commit

Permalink
Merge pull request #27 from Zoddo/numeric-396
Browse files Browse the repository at this point in the history
Send RPL_HOSTHIDDEN on host changes
  • Loading branch information
tmcarthur committed Jun 9, 2015
2 parents f91c87b + 9b9a35a commit d1b3cb9
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/numeric.h
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/modules/m_chghost.c
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/modules/m_mode.c
Expand Up @@ -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))
Expand All @@ -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...
Expand Down
3 changes: 3 additions & 0 deletions src/modules/m_nick.c
Expand Up @@ -1373,6 +1373,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,
Expand Down
1 change: 1 addition & 0 deletions src/modules/m_sethost.c
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/modules/m_vhost.c
Expand Up @@ -176,6 +176,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 : "",
Expand Down
2 changes: 1 addition & 1 deletion src/s_err.c
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/s_user.c
Expand Up @@ -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)
Expand Down

0 comments on commit d1b3cb9

Please sign in to comment.