summaryrefslogtreecommitdiff
path: root/modules/commands/cs_topic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_topic.cpp')
-rw-r--r--modules/commands/cs_topic.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp
index e1aba12fb..5badaa12d 100644
--- a/modules/commands/cs_topic.cpp
+++ b/modules/commands/cs_topic.cpp
@@ -26,7 +26,6 @@ class CommandCSTopic : public Command
{
const Anope::string &topic = params.size() > 1 ? params[1] : "";
- User *u = source.u;
ChannelInfo *ci = cs_findchan(params[0]);
if (ci == NULL)
@@ -37,18 +36,18 @@ class CommandCSTopic : public Command
if (!ci->c)
source.Reply(CHAN_X_NOT_IN_USE, ci->name.c_str());
- else if (!ci->AccessFor(u).HasPriv("TOPIC") && !u->HasCommand("chanserv/topic"))
+ else if (!source.AccessFor(ci).HasPriv("TOPIC") && !source.HasCommand("chanserv/topic"))
source.Reply(ACCESS_DENIED);
else
{
bool has_topiclock = ci->HasFlag(CI_TOPICLOCK);
ci->UnsetFlag(CI_TOPICLOCK);
- ci->c->ChangeTopic(u->nick, topic, Anope::CurTime);
+ ci->c->ChangeTopic(source.GetNick(), topic, Anope::CurTime);
if (has_topiclock)
ci->SetFlag(CI_TOPICLOCK);
- bool override = !ci->AccessFor(u).HasPriv("TOPIC");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << (!topic.empty() ? "to change the topic to: " : "to unset the topic") << (!topic.empty() ? topic : "");
+ bool override = !source.AccessFor(ci).HasPriv("TOPIC");
+ Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << (!topic.empty() ? "to change the topic to: " : "to unset the topic") << (!topic.empty() ? topic : "");
}
return;
}