From c8aae1c6ee39b7a2bf3a3f8b03798aa4821f85c5 Mon Sep 17 00:00:00 2001 From: rburchell Date: Sun, 15 Feb 2009 15:24:12 +0000 Subject: [PATCH] Implement opertype methods for priv/command access. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2069 5417fbe8-f217-4b02-8779-1006273d7864 --- src/opertype.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/opertype.cpp b/src/opertype.cpp index a90ac9de5..7e93d1925 100644 --- a/src/opertype.cpp +++ b/src/opertype.cpp @@ -17,12 +17,28 @@ OperType::OperType(const std::string &nname) : name(nname) bool OperType::HasCommand(const std::string &cmdstr) const { + for (std::list::const_iterator it = this->commands.begin(); it != this->commands.end(); it++) + { + if (Anope::Match(cmdstr, *it)) + { + return true; + } + } + return false; } bool OperType::HasPriv(const std::string &privstr) const { + for (std::list::const_iterator it = this->privs.begin(); it != this->privs.end(); it++) + { + if (Anope::Match(privstr, *it)) + { + return true; + } + } + return false; } void OperType::AddCommand(const std::string &cmdstr)