diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-08 20:06:21 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-08 20:06:21 +0000 |
commit | 458be36a321615c0f3004a6abde7e14d40f5da32 (patch) | |
tree | 711be83fc6f2d49f9d31015db51730cdac57f687 /src/modules | |
parent | 38ad96c57c520dd84c8de21766f5de082a844a99 (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')
-rw-r--r-- | src/modules/cs_appendtopic.c | 2 | ||||
-rw-r--r-- | src/modules/cs_enforce.c | 21 | ||||
-rw-r--r-- | src/modules/ns_noop_convert.c | 2 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/modules/cs_appendtopic.c b/src/modules/cs_appendtopic.c index 5eda7bce6..c67b68b4e 100644 --- a/src/modules/cs_appendtopic.c +++ b/src/modules/cs_appendtopic.c @@ -70,8 +70,6 @@ class CommandCSAppendTopic : 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_TOPIC)) notice_lang(s_ChanServ, u, ACCESS_DENIED); else 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 diff --git a/src/modules/ns_noop_convert.c b/src/modules/ns_noop_convert.c index ae0127b97..004693e35 100644 --- a/src/modules/ns_noop_convert.c +++ b/src/modules/ns_noop_convert.c @@ -112,7 +112,7 @@ int mLoadData() /* Take the \n from the end of the line */ name[len - 1] = '\0'; if ((na = findnick(name))) { - na->nc->flags |= NI_AUTOOP; + na->nc->SetFlag(NI_AUTOOP); } delete [] name; } |