summaryrefslogtreecommitdiff
path: root/src/s_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/s_user.c')
-rw-r--r--src/s_user.c28
1 files changed, 15 insertions, 13 deletions
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);
}