diff options
author | lethality <lethality@anope.org> | 2012-06-22 21:26:33 +0100 |
---|---|---|
committer | lethality <lethality@anope.org> | 2012-06-22 21:26:33 +0100 |
commit | d8a99d619f7ae301ecf188dc460b1f5c7cb791ac (patch) | |
tree | b327ce05b9b5cb598fbc829e48041d465bc2d579 /modules/commands/cs_topic.cpp | |
parent | ba53c7eb03add30acefbbc95bbd8b4b825b465b0 (diff) | |
parent | 2dec8e767a70def4b9b04a96ae4f75e4d1013038 (diff) |
Merge branch '1.9' of ssh://anope.git.sf.net/gitroot/anope/anope into 1.9
Diffstat (limited to 'modules/commands/cs_topic.cpp')
-rw-r--r-- | modules/commands/cs_topic.cpp | 9 |
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; } |