diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-05-30 10:56:53 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-05-30 10:56:53 +0000 |
commit | 040e76a005043fe2993eb17f1ae37efbf67ad37c (patch) | |
tree | 5b0e9e05507d13bda8f4ff151e2f593c78c82139 | |
parent | 9f69ad60ff28ba4f1d22b0e92fcf54f1757dcac4 (diff) |
- m_svsmode(), user_set_hostmask(): minor cleanups and fixes to previous commit
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2144 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | modules/m_svsmode.c | 8 | ||||
-rw-r--r-- | src/numeric.c | 2 | ||||
-rw-r--r-- | src/s_user.c | 28 |
3 files changed, 17 insertions, 21 deletions
diff --git a/modules/m_svsmode.c b/modules/m_svsmode.c index 6c42aa0..d54f664 100644 --- a/modules/m_svsmode.c +++ b/modules/m_svsmode.c @@ -107,13 +107,7 @@ ms_svsmode(struct Client *client_p, struct Client *source_p, case 'x': if (!EmptyString(extarg) && valid_hostname(extarg)) - { - if (what == MODE_DEL && HasUMode(target_p, UMODE_HIDDENHOST)) - user_set_hostmask(target_p, extarg, what); - if (what == MODE_ADD && !HasUMode(target_p, UMODE_HIDDENHOST)) - user_set_hostmask(target_p, extarg, what); - } - + user_set_hostmask(target_p, extarg, what); break; case 'o': diff --git a/src/numeric.c b/src/numeric.c index 0d4058f..17d7656 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -312,7 +312,7 @@ static const char *replies[] = { /* 282 RPL_ENDOFACCEPT */ ":%s 282 %s :End of /ACCEPT list.", /* 283 */ NULL, /* 284 */ NULL, -/* 285 RPL_NEWHOSTIS */ ":%s 285 %s :Your new host is - [%s@%s]", +/* 285 RPL_NEWHOSTIS */ ":%s 285 %s :Your new host is %s", /* 286 */ NULL, /* 287 */ NULL, /* 288 */ NULL, diff --git a/src/s_user.c b/src/s_user.c index d63eebe..095100e 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -1057,16 +1057,8 @@ user_set_hostmask(struct Client *target_p, const char *hostname, const int what) { dlink_node *ptr = NULL; - sendto_common_channels_local(target_p, 0, 0, ":%s!%s@%s QUIT :Changing hostname", - target_p->name, target_p->username, target_p->host); - - if (IsUserHostIp(target_p)) - delete_user_host(target_p->username, target_p->host, !MyConnect(target_p)); - - strlcpy(target_p->host, hostname, sizeof(target_p->host)); - - add_user_host(target_p->username, target_p->host, !MyConnect(target_p)); - SetUserHost(target_p); + if (!strcmp(target_p->host, hostname)) + return; switch (what) { @@ -1080,14 +1072,24 @@ user_set_hostmask(struct Client *target_p, const char *hostname, const int what) if (!HasFlag(target_p, FLAGS_AUTH_SPOOF)) DelFlag(target_p, FLAGS_IP_SPOOFING); break; - default: break; + default: return; } + sendto_common_channels_local(target_p, 0, 0, ":%s!%s@%s QUIT :Changing hostname", + target_p->name, target_p->username, target_p->host); + + if (IsUserHostIp(target_p)) + delete_user_host(target_p->username, target_p->host, !MyConnect(target_p)); + + strlcpy(target_p->host, hostname, sizeof(target_p->host)); + + add_user_host(target_p->username, target_p->host, !MyConnect(target_p)); + SetUserHost(target_p); + if (MyClient(target_p)) { sendto_one(target_p, form_str(RPL_NEWHOSTIS), me.name, - target_p->name, target_p->username, - target_p->host); + target_p->name, target_p->host); clear_ban_cache_client(target_p); } |