diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regchannel.cpp | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 3b246fece..9bf3122c4 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -205,47 +205,6 @@ ChanAccess *ChannelInfo::GetAccess(unsigned index) return this->access[index]; } -/** Check if a user has a privilege on a channel - * - * @param u The User to find within the access list vector - * @param priv The privilege to check for. - * @return true if the user has the privilege - * - * Retrieves an entry from the access list that matches the given User and NickCore. - */ -bool ChannelInfo::HasPriv(User *u, ChannelAccess priv) -{ - AccessGroup group = this->AccessFor(u); - - if (u->SuperAdmin) - return true; - - if (this->founder && u->Account() == this->founder) - { - switch (priv) - { - case CA_AUTOOWNER: - case CA_AUTOPROTECT: - case CA_AUTOOP: - case CA_AUTOHALFOP: - case CA_AUTOVOICE: - break; - default: - this->last_used = Anope::CurTime; - return true; - } - } - - - if (group.HasPriv(CA_FOUNDER) || group.HasPriv(priv)) - { - this->last_used = Anope::CurTime; - return true; - } - - return false; -} - AccessGroup ChannelInfo::AccessFor(User *u) { NickCore *nc = u->Account(); @@ -266,6 +225,9 @@ AccessGroup ChannelInfo::AccessFor(User *u) if (this->access[i]->Matches(u, nc)) group.push_back(this->access[i]); + if (!group.empty()) + this->last_used = Anope::CurTime; + return group; } |