diff options
Diffstat (limited to 'src/access.cpp')
-rw-r--r-- | src/access.cpp | 16 |
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(); |