summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/access.cpp6
-rw-r--r--src/bots.cpp2
-rw-r--r--src/regchannel.cpp2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/access.cpp b/src/access.cpp
index 3559a8209..3c1eb8714 100644
--- a/src/access.cpp
+++ b/src/access.cpp
@@ -82,6 +82,7 @@ bool ChanAccess::operator<=(ChanAccess &other)
AccessGroup::AccessGroup() : std::vector<ChanAccess *>()
{
this->ci = NULL;
+ this->nc = NULL;
this->SuperAdmin = this->Founder = false;
}
@@ -93,10 +94,13 @@ bool AccessGroup::HasPriv(ChannelAccess priv) const
return false;
else if (this->Founder)
return true;
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnGroupCheckPriv, OnGroupCheckPriv(this, priv));
+ if (MOD_RESULT != EVENT_CONTINUE)
+ return MOD_RESULT == EVENT_ALLOW;
for (unsigned i = this->size(); i > 0; --i)
{
ChanAccess *access = this->at(i - 1);
- EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnCheckPriv, OnCheckPriv(access, priv));
if (MOD_RESULT == EVENT_ALLOW || access->HasPriv(priv))
return true;
diff --git a/src/bots.cpp b/src/bots.cpp
index 3e9af64d5..b794610e6 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -13,7 +13,7 @@
Anope::insensitive_map<BotInfo *> BotListByNick;
Anope::map<BotInfo *> BotListByUID;
-BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal, const Anope::string &modes) : User(nnick, nuser, nhost, ts6_uid_retrieve()), Flags<BotFlag, BI_END>(BotFlagString), botmodes(modes)
+BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal, const Anope::string &bmodes) : User(nnick, nuser, nhost, ts6_uid_retrieve()), Flags<BotFlag, BI_END>(BotFlagString), botmodes(bmodes)
{
this->realname = nreal;
this->server = Me;
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 9bf3122c4..e57f555ac 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -220,6 +220,7 @@ AccessGroup ChannelInfo::AccessFor(User *u)
group.SuperAdmin = u->SuperAdmin;
group.Founder = IsFounder(u, this);
group.ci = this;
+ group.nc = u->Account();
for (unsigned i = 0, end = this->access.size(); i < end; ++i)
if (this->access[i]->Matches(u, nc))
@@ -237,6 +238,7 @@ AccessGroup ChannelInfo::AccessFor(NickCore *nc)
group.Founder = (this->founder && this->founder == nc);
group.ci = this;
+ group.nc = nc;
for (unsigned i = 0, end = this->access.size(); i < end; ++i)
if (this->access[i]->Matches(NULL, nc))