summaryrefslogtreecommitdiff
path: root/src/access.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-12-31 01:33:32 -0500
committerAdam <Adam@anope.org>2011-12-31 01:33:32 -0500
commit20aa4e85ce11a5d286f027638c4af82251c2afb9 (patch)
tree398140734d25134002f633c4c6dac6510584580b /src/access.cpp
parentf1b05acf269817b9fd70bab24fe66fbfe936beba (diff)
Bug #1368 - check all members of a users gruop against the access list
Diffstat (limited to 'src/access.cpp')
-rw-r--r--src/access.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/access.cpp b/src/access.cpp
index 26622e6d6..06f0d2ef6 100644
--- a/src/access.cpp
+++ b/src/access.cpp
@@ -120,6 +120,22 @@ void ChanAccess::unserialize(serialized_data &data)
ci->AddAccess(access);
}
+bool ChanAccess::Matches(User *u, NickCore *nc)
+{
+ if (u && Anope::Match(u->nick, this->mask))
+ return true;
+ else if (u && Anope::Match(u->GetDisplayedMask(), this->mask))
+ return true;
+ else if (nc)
+ for (std::list<NickAlias *>::iterator it = nc->aliases.begin(); it != nc->aliases.end(); ++it)
+ {
+ NickAlias *na = *it;
+ if (Anope::Match(na->nick, this->mask))
+ return true;
+ }
+ return false;
+}
+
bool ChanAccess::operator>(const ChanAccess &other) const
{
const std::vector<Privilege> &privs = PrivilegeManager::GetPrivileges();