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 /modules/extra | |
| parent | 2264a206d262f07f6c6d91df867383d6413e0c3f (diff) | |
More properly track topic change sources and allow users with access to change topics through topiclock
Diffstat (limited to 'modules/extra')
| -rw-r--r-- | modules/extra/stats/irc2sql/irc2sql.cpp | 2 | ||||
| -rw-r--r-- | modules/extra/stats/irc2sql/irc2sql.h | 2 | ||||
| -rw-r--r-- | modules/extra/stats/m_chanstats.cpp | 7 |
3 files changed, 5 insertions, 6 deletions
diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp index fd0ca5890..87ede04fd 100644 --- a/modules/extra/stats/irc2sql/irc2sql.cpp +++ b/modules/extra/stats/irc2sql/irc2sql.cpp @@ -243,7 +243,7 @@ void IRC2SQL::OnLeaveChannel(User *u, Channel *c) this->RunQuery(query); } -void IRC2SQL::OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) +void IRC2SQL::OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) { query = "UPDATE `" + prefix + "chan` " "SET topic=@topic@, topicauthor=@author@, topictime=FROM_UNIXTIME(@time@) " diff --git a/modules/extra/stats/irc2sql/irc2sql.h b/modules/extra/stats/irc2sql/irc2sql.h index 0c516f5e3..1ed5790aa 100644 --- a/modules/extra/stats/irc2sql/irc2sql.h +++ b/modules/extra/stats/irc2sql/irc2sql.h @@ -69,7 +69,7 @@ class IRC2SQL : public Module EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override; EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override; - 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; void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) anope_override; }; diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 7a2fe0486..27b1b3eae 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -517,14 +517,13 @@ class MChanstats : public Module info.AddOption(_("Chanstats")); } - 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 { - User *u = User::Find(user); - if (!u || !u->Account() || !c->ci || !cs_stats.HasExt(c->ci)) + if (!source || !source->Account() || !c->ci || !cs_stats.HasExt(c->ci)) return; query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);"; query.SetValue("channel", c->name); - query.SetValue("nick", GetDisplay(u)); + query.SetValue("nick", GetDisplay(source)); this->RunQuery(query); } |
