1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 06:43:13 +02:00

Allow inverting opertype privs and commands, to make them behave like the log settings

This commit is contained in:
Adam
2013-12-27 17:20:47 -05:00
parent 072631aa38
commit 187973c16a
+10 -2
View File
@@ -60,7 +60,11 @@ bool OperType::HasCommand(const Anope::string &cmdstr) const
{
for (std::list<Anope::string>::const_iterator it = this->commands.begin(), it_end = this->commands.end(); it != it_end; ++it)
{
if (Anope::Match(cmdstr, *it))
const Anope::string &s = *it;
if (!s.find('~') && Anope::Match(cmdstr, s.substr(1)))
return false;
else if (Anope::Match(cmdstr, s))
return true;
}
for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(), iit_end = this->inheritances.end(); iit != iit_end; ++iit)
@@ -78,7 +82,11 @@ bool OperType::HasPriv(const Anope::string &privstr) const
{
for (std::list<Anope::string>::const_iterator it = this->privs.begin(), it_end = this->privs.end(); it != it_end; ++it)
{
if (Anope::Match(privstr, *it))
const Anope::string &s = *it;
if (!s.find('~') && Anope::Match(privstr, s.substr(1)))
return false;
else if (Anope::Match(privstr, s))
return true;
}
for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(), iit_end = this->inheritances.end(); iit != iit_end; ++iit)