summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-11-11 12:58:14 -0500
committerAdam <Adam@anope.org>2016-11-11 12:58:14 -0500
commitef5b6919e3508cc9d4c722285d9d56f5a275f650 (patch)
tree56497f0a4f5d1847bae511c72bdb2d3581df58ef /src/command.cpp
parent8dd6e3195ed7600e39935e887df2626215733dfb (diff)
Fix opers not really being serializable
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/command.cpp b/src/command.cpp
index ade17fd45..f1cae4bb3 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -74,8 +74,10 @@ bool CommandSource::HasCommand(const Anope::string &cmd)
{
if (this->u)
return this->u->HasCommand(cmd);
- else if (this->nc && this->nc->o)
- return this->nc->o->GetType()->HasCommand(cmd);
+
+ if (this->nc && this->nc->GetOper())
+ return this->nc->GetOper()->HasCommand(cmd);
+
return false;
}
@@ -83,8 +85,10 @@ bool CommandSource::HasPriv(const Anope::string &cmd)
{
if (this->u)
return this->u->HasPriv(cmd);
- else if (this->nc && this->nc->o)
- return this->nc->o->GetType()->HasPriv(cmd);
+
+ if (this->nc && this->nc->GetOper())
+ return this->nc->GetOper()->HasPriv(cmd);
+
return false;
}
@@ -93,7 +97,7 @@ bool CommandSource::IsServicesOper()
if (this->u)
return this->u->IsServicesOper();
else if (this->nc)
- return this->nc->IsServicesOper();
+ return this->nc->GetOper() != nullptr;
return false;
}
@@ -102,7 +106,7 @@ bool CommandSource::IsOper()
if (this->u)
return this->u->HasMode("OPER");
else if (this->nc)
- return this->nc->IsServicesOper();
+ return this->nc->GetOper() != nullptr;
return false;
}