* @param[in] flag Some flag that affects host-hiding (FLAG_HIDDENHOST, FLAG_ACCOUNT, FLAG_FAKEHOST).
* @return Zero.
*/
+
int
-hide_hostmask(struct Client *cptr, unsigned int flag)
+hide_hostmask(struct Client *cptr, unsigned int flag) {
+ return hide_hostmask(chptr, flag, NULL);
+}
+
+int
+hide_hostmask(struct Client *cptr, unsigned int flag, char *username)
{
struct Membership *chan;
char buf[HOSTLEN];
sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered");
ircd_strncpy(cli_user(cptr)->host, buf, HOSTLEN);
- /* ok, the client is now fully hidden, so let them know -- hikari */
- if (MyConnect(cptr))
- send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host);
+ /* spoof also the username if username is passed */
+ if(username) {
+ ircd_strncpy(cli_user(cptr)->username, username, USERLEN);
+ /* ok, the client is now fully hidden, so let them know -- hikari */
+ if (MyConnect(cptr))
+ send_reply(cptr, RPL_HOSTUSERHIDDEN, cli_user(cptr)->username, cli_user(cptr)->host);
+ } else {
+ /* ok, the client is now fully hidden, so let them know -- hikari */
+ if (MyConnect(cptr))
+ send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host);
+ }
/*
* Go through all channels the client was on, rejoin him