- change_nick_user_host(source_p, source_p->name, source_p->username, buf, 0, "Changing host");
+ /* If hostname has been changed already (probably by services cloak on SASL login), then
+ * leave it intact. If not, change it. In either case, update the original hostname.
+ */
+ if (0 == irccmp(source_p->host, source_p->orighost))
+ change_nick_user_host(source_p, source_p->name, source_p->username, buf, 0, "Changing host");
+ strncpy(source_p->orighost, buf, HOSTLEN);
+
+ {
+ struct ConfItem *aconf = find_kline(source_p);
+
+ if(aconf == NULL)
+ return;
+
+ if(IsExemptKline(source_p))
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
+ "KLINE over-ruled for %s, client is kline_exempt [%s@%s]",
+ get_client_name(source_p, HIDE_IP),
+ aconf->user, aconf->host);
+ return;
+ }
+
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "KLINE active for %s",
+ get_client_name(source_p, HIDE_IP));
+
+ notify_banned_client(source_p, aconf, K_LINED);
+ }