diff options
author | Adam <Adam@anope.org> | 2015-01-28 22:57:15 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-01-28 22:57:15 -0500 |
commit | 845ca576b4c5a94f0a3ec12a4dd524a7d017155e (patch) | |
tree | 2636bc0ccdf94f957a955277dd89155de49360b6 /src/channels.cpp | |
parent | 2264a206d262f07f6c6d91df867383d6413e0c3f (diff) |
More properly track topic change sources and allow users with access to change topics through topiclock
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index b1038f69e..7e7702d7e 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -789,26 +789,22 @@ bool Channel::Kick(BotInfo *bi, User *u, const char *reason, ...) return true; } -void Channel::ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts) +void Channel::ChangeTopicInternal(User *u, const Anope::string &user, const Anope::string &newtopic, time_t ts) { - User *u = User::Find(user); - this->topic = newtopic; this->topic_setter = u ? u->nick : user; this->topic_ts = ts; this->topic_time = Anope::CurTime; - Log(LOG_DEBUG) << "Topic of " << this->name << " changed by " << (u ? u->nick : user) << " to " << newtopic; + Log(LOG_DEBUG) << "Topic of " << this->name << " changed by " << this->topic_setter << " to " << newtopic; - FOREACH_MOD(OnTopicUpdated, (this, user, this->topic)); + FOREACH_MOD(OnTopicUpdated, (u, this, user, this->topic)); } void Channel::ChangeTopic(const Anope::string &user, const Anope::string &newtopic, time_t ts) { - User *u = User::Find(user); - this->topic = newtopic; - this->topic_setter = u ? u->nick : user; + this->topic_setter = user; this->topic_ts = ts; IRCD->SendTopic(this->ci->WhoSends(), this); @@ -816,7 +812,7 @@ void Channel::ChangeTopic(const Anope::string &user, const Anope::string &newtop /* Now that the topic is set update the time set. This is *after* we set it so the protocol modules are able to tell the old last set time */ this->topic_time = Anope::CurTime; - FOREACH_MOD(OnTopicUpdated, (this, user, this->topic)); + FOREACH_MOD(OnTopicUpdated, (NULL, this, user, this->topic)); } void Channel::SetCorrectModes(User *user, bool give_modes) |