summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-05-30 00:44:04 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-05-30 00:44:04 +0000
commit110be8119af5cc8d9d337265080063cb893ed3ac (patch)
tree479598f93156d40ff5c4c10488172a4e3f3d7fb7 /src
parent68c2b3ae7f14471ce7a86689a59d9317024180ea (diff)
- s_user.c:user_set_hostmask(): send a QUIT/JOIN combination to other channel
members to avoid desynchronized IALs git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2140 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r--src/s_user.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/s_user.c b/src/s_user.c
index 8190ca2..9b4dc13 100644
--- a/src/s_user.c
+++ b/src/s_user.c
@@ -1055,6 +1055,11 @@ send_umode_out(struct Client *client_p, struct Client *source_p,
void
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));
@@ -1072,7 +1077,7 @@ user_set_hostmask(struct Client *target_p, const char *hostname, const int what)
case MODE_DEL:
DelUMode(target_p, UMODE_HIDDENHOST);
- if (!HasFlag(target_p, FLAGS_AUTH_SPOOF));
+ if (!HasFlag(target_p, FLAGS_AUTH_SPOOF))
DelFlag(target_p, FLAGS_IP_SPOOFING);
break;
default: break;
@@ -1085,6 +1090,46 @@ user_set_hostmask(struct Client *target_p, const char *hostname, const int what)
target_p->host);
clear_ban_cache_client(target_p);
}
+
+ DLINK_FOREACH(ptr, target_p->channel.head)
+ {
+ char modebuf[4], nickbuf[NICKLEN * 3 + 3];
+ char *p = modebuf;
+ int len = 0;
+ const struct Membership *ms = ptr->data;
+
+ if (has_member_flags(ms, CHFL_CHANOP)) {
+ *p++ = 'o';
+ len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name);
+ }
+
+ if (has_member_flags(ms, CHFL_HALFOP)) {
+ *p++ = 'h';
+ len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name);
+ }
+
+ if (has_member_flags(ms, CHFL_VOICE)) {
+ *p++ = 'v';
+ len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name);
+ }
+
+ *p = '\0';
+
+ sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s!%s@%s JOIN :%s",
+ target_p->name, target_p->username, target_p->host,
+ ms->chptr->chname);
+ if (nickbuf[0])
+ sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s MODE %s +%s %s",
+ target_p->servptr->name, ms->chptr->chname,
+ modebuf, nickbuf);
+
+ }
+
+ if (target_p->away[0])
+ sendto_common_channels_local(target_p, 0, CAP_AWAY_NOTIFY,
+ ":%s!%s@%s AWAY :%s",
+ target_p->name, target_p->username,
+ target_p->host, target_p->away);
}
/* user_welcome()