summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/m_svsmode.c8
-rw-r--r--src/numeric.c2
-rw-r--r--src/s_user.c28
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);
}