1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 10:36:38 +02:00

Allow userless command sources

This commit is contained in:
Adam
2012-06-18 05:04:30 -04:00
parent 873d4287de
commit 2dec8e767a
153 changed files with 1029 additions and 1060 deletions
+4 -5
View File
@@ -52,14 +52,13 @@ class CommandCSAppendTopic : public Command
{
const Anope::string &newtopic = params[1];
User *u = source.u;
Channel *c = findchan(params[0]);;
if (!c)
source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str());
else if (!c->ci)
source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str());
else if (!c->ci->AccessFor(u).HasPriv("TOPIC") && !u->HasCommand("chanserv/topic"))
else if (!source.AccessFor(c->ci).HasPriv("TOPIC") && !source.HasCommand("chanserv/topic"))
source.Reply(ACCESS_DENIED);
else
{
@@ -74,12 +73,12 @@ class CommandCSAppendTopic : public Command
bool has_topiclock = c->ci->HasFlag(CI_TOPICLOCK);
c->ci->UnsetFlag(CI_TOPICLOCK);
c->ChangeTopic(u->nick, topic, Anope::CurTime);
c->ChangeTopic(source.GetNick(), topic, Anope::CurTime);
if (has_topiclock)
c->ci->SetFlag(CI_TOPICLOCK);
bool override = !c->ci->AccessFor(u).HasPriv("TOPIC");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci) << "to append: " << topic;
bool override = !source.AccessFor(c->ci).HasPriv("TOPIC");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, c->ci) << "to append: " << topic;
}
return;
}