summaryrefslogtreecommitdiff
path: root/src/modules/cs_enforce.c
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-08 20:06:21 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-08 20:06:21 +0000
commit458be36a321615c0f3004a6abde7e14d40f5da32 (patch)
tree711be83fc6f2d49f9d31015db51730cdac57f687 /src/modules/cs_enforce.c
parent38ad96c57c520dd84c8de21766f5de082a844a99 (diff)
Rewrote all of the old C style flag systems into a new Flag class which everything inherits from. This breaks reading and writing flags to the old databases (and probably many other things aswell) - Don't use it
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2636 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules/cs_enforce.c')
-rw-r--r--src/modules/cs_enforce.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/modules/cs_enforce.c b/src/modules/cs_enforce.c
index 65807c6e4..47b90db45 100644
--- a/src/modules/cs_enforce.c
+++ b/src/modules/cs_enforce.c
@@ -39,9 +39,9 @@ class CommandCSEnforce : public Command
if (!(ci = c->ci))
return;
- if (ci->flags & CI_SECUREOPS)
+ if (ci->HasFlag(CI_SECUREOPS))
this->DoSecureOps(c);
- if (ci->flags & CI_RESTRICTED)
+ if (ci->HasFlag(CI_RESTRICTED))
this->DoRestricted(c);
}
@@ -56,7 +56,7 @@ class CommandCSEnforce : public Command
struct c_userlist *user;
struct c_userlist *next;
ChannelInfo *ci;
- uint32 flags;
+ bool hadsecureops = false;
if (!(ci = c->ci))
return;
@@ -69,8 +69,11 @@ class CommandCSEnforce : public Command
* part of the code. This way we can enforce SECUREOPS even
* if it's off.
*/
- flags = ci->flags;
- ci->flags |= CI_SECUREOPS;
+ if (!ci->HasFlag(CI_SECUREOPS))
+ {
+ ci->SetFlag(CI_SECUREOPS);
+ hadsecureops = true;
+ }
user = c->users;
do
@@ -80,7 +83,11 @@ class CommandCSEnforce : public Command
user = next;
} while (user);
- ci->flags = flags;
+ if (hadsecureops)
+ {
+ ci->UnsetFlag(CI_SECUREOPS);
+ }
+
}
void DoRestricted(Channel *c)
@@ -187,8 +194,6 @@ class CommandCSEnforce : public Command
if (!c)
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
- else if (ci->flags & CI_FORBIDDEN)
- notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, ci->name);
else if (!check_access(u, ci, CA_AKICK))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
else