diff options
author | Adam <Adam@anope.org> | 2010-06-28 10:59:40 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-28 10:59:40 -0400 |
commit | 4502038e3da0e176e194aabfd64c85544bb0aa23 (patch) | |
tree | 6b52e3b3bd0753adc7884a352e934dfbd4aae902 /src/protocol/unreal32.cpp | |
parent | 85b07a94d7d0c54e221dbbb8333870beb47bb3ac (diff) |
Unset all known status modes when we recieve a ts older than ours, and remove split servers from their uplinks
Diffstat (limited to 'src/protocol/unreal32.cpp')
-rw-r--r-- | src/protocol/unreal32.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/protocol/unreal32.cpp b/src/protocol/unreal32.cpp index dff0421d2..cb4194ac7 100644 --- a/src/protocol/unreal32.cpp +++ b/src/protocol/unreal32.cpp @@ -1035,16 +1035,21 @@ int anope_event_sjoin(const char *source, int ac, const char **av) { c->creation_time = ts; - /* Remove status from all of our users */ - for (CUserList::iterator it = c->users.begin(); it != c->users.end(); ++it) + for (std::list<Mode *>::const_iterator it =ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it) { - UserContainer *uc = *it; + Mode *m = *it; - c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick); - c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick); - c->RemoveMode(NULL, CMODE_OP, uc->user->nick); - c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick); - c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick); + if (m->Type != MODE_STATUS) + continue; + + ChannelMode *cm = dynamic_cast<ChannelMode *>(m); + + for (CUserList::const_iterator uit = c->users.begin(), uit_end = c->users.end(); uit != uit_end; ++uit) + { + UserContainer *uc = *uit; + + c->RemoveMode(NULL, cm, uc->user->nick); + } } if (c->ci) { |