1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 21:13:13 +02:00

More properly track topic change sources and allow users with access to change topics through topiclock

This commit is contained in:
Adam
2015-01-28 22:57:15 -05:00
parent 2264a206d2
commit 845ca576b4
14 changed files with 27 additions and 31 deletions
+2 -2
View File
@@ -227,7 +227,7 @@ class CSTopic : public Module
}
}
void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) anope_override
void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) anope_override
{
if (!c->ci)
return;
@@ -237,7 +237,7 @@ class CSTopic : public Module
* This desyncs what is really set with what we have stored, and we end up resetting the topic often when
* it is not required
*/
if (topiclock.HasExt(c->ci) && c->ci->last_topic != c->topic)
if (topiclock.HasExt(c->ci) && c->ci->last_topic != c->topic && (!source || !c->ci->AccessFor(source).HasPriv("TOPIC")))
{
c->ChangeTopic(c->ci->last_topic_setter, c->ci->last_topic, c->ci->last_topic_time);
}