From 4502038e3da0e176e194aabfd64c85544bb0aa23 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 28 Jun 2010 10:59:40 -0400 Subject: Unset all known status modes when we recieve a ts older than ours, and remove split servers from their uplinks --- src/protocol/ratbox.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/protocol/ratbox.cpp') diff --git a/src/protocol/ratbox.cpp b/src/protocol/ratbox.cpp index 9285411c8..e1cb9ce46 100644 --- a/src/protocol/ratbox.cpp +++ b/src/protocol/ratbox.cpp @@ -319,15 +319,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::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(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) { -- cgit