summaryrefslogtreecommitdiff
path: root/modules/commands/cs_set_founder.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
committerAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
commit2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch)
tree36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/cs_set_founder.cpp
parent873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff)
Allow userless command sources
Diffstat (limited to 'modules/commands/cs_set_founder.cpp')
-rw-r--r--modules/commands/cs_set_founder.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/commands/cs_set_founder.cpp b/modules/commands/cs_set_founder.cpp
index 5f2990196..037ec62ff 100644
--- a/modules/commands/cs_set_founder.cpp
+++ b/modules/commands/cs_set_founder.cpp
@@ -24,7 +24,6 @@ class CommandCSSetFounder : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
- User *u = source.u;
ChannelInfo *ci = cs_findchan(params[0]);
if (ci == NULL)
{
@@ -32,13 +31,13 @@ class CommandCSSetFounder : public Command
return;
}
- if (source.permission.empty() && !ci->AccessFor(u).HasPriv("SET"))
+ if (source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
- if (source.permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->AccessFor(u).HasPriv("FOUNDER")))
+ if (source.permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")))
{
source.Reply(ACCESS_DENIED);
return;
@@ -52,13 +51,13 @@ class CommandCSSetFounder : public Command
}
NickCore *nc = na->nc;
- if (Config->CSMaxReg && nc->channelcount >= Config->CSMaxReg && !u->HasPriv("chanserv/no-register-limit"))
+ if (Config->CSMaxReg && nc->channelcount >= Config->CSMaxReg && !source.HasPriv("chanserv/no-register-limit"))
{
source.Reply(_("\002%s\002 has too many channels registered."), na->nick.c_str());
return;
}
- Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the founder from " << (ci->GetFounder() ? ci->GetFounder()->display : "(none)") << " to " << nc->display;
+ Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to change the founder from " << (ci->GetFounder() ? ci->GetFounder()->display : "(none)") << " to " << nc->display;
ci->SetFounder(nc);