From 0ed0fa4af62554a7281d403b6895b29e198e8186 Mon Sep 17 00:00:00 2001 From: Adam- Date: Thu, 21 Jan 2010 06:31:17 +0000 Subject: Rewrote how Anope stores channel status modes on users. This allows 3rd party modules to add and track their own status mode. Additionally we now store a users status in both the UserContainer and ChannelContainer. This also fixes the ModeStacker to not send any mode strings unnecessarially and shuffles some code around so we don't have to manually remove channels from users lists everywhere. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2775 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/os_clearmodes.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'src/core/os_clearmodes.c') diff --git a/src/core/os_clearmodes.c b/src/core/os_clearmodes.c index d0bc4c44b..f52cd12ae 100644 --- a/src/core/os_clearmodes.c +++ b/src/core/os_clearmodes.c @@ -65,10 +65,8 @@ class CommandOSClearModes : public Command { UserContainer *uc = *it; - if (!chan_has_user_status(c, uc->user, CUS_OP)) - continue; - - c->RemoveMode(NULL, CMODE_OP, uc->user->nick); + if (uc->Status->HasFlag(CMODE_OP)) + c->RemoveMode(NULL, CMODE_OP, uc->user->nick); } } @@ -81,10 +79,8 @@ class CommandOSClearModes : public Command { UserContainer *uc = *it; - if (!chan_has_user_status(c, uc->user, CUS_VOICE)) - continue; - - c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick); + if (uc->Status->HasFlag(CMODE_VOICE)) + c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick); } } @@ -99,10 +95,8 @@ class CommandOSClearModes : public Command { UserContainer *uc = *it; - if (!chan_has_user_status(c, uc->user, CUS_HALFOP)) - continue; - - c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick); + if (uc->Status->HasFlag(CMODE_HALFOP)) + c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick); } } } @@ -121,10 +115,8 @@ class CommandOSClearModes : public Command { UserContainer *uc = *it; - if (!chan_has_user_status(c, uc->user, CUS_OWNER)) - continue; - - c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick); + if (uc->Status->HasFlag(CMODE_OWNER)) + c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick); } } } @@ -143,10 +135,8 @@ class CommandOSClearModes : public Command { UserContainer *uc = *it; - if (!chan_has_user_status(c, uc->user, CUS_PROTECT)) - continue; - - c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick); + if (uc->Status->HasFlag(CMODE_PROTECT)) + c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick); } } } -- cgit