diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2014-01-19 08:11:19 +0100 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2014-01-19 08:11:19 +0100 |
commit | df8d85d80aae4af79293f52095ab487a745bef5a (patch) | |
tree | 6295426894e2103540ce50d8e8e9b8d469d29b79 /modules/extra | |
parent | 4b192addd2fbd20c2dd98530cd57580fa41bd30e (diff) |
m_chanstats: fixed the config options NSDefChanstats and CSDefChanstats
Diffstat (limited to 'modules/extra')
-rw-r--r-- | modules/extra/stats/m_chanstats.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index c3be9d640..1ca670368 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -168,6 +168,7 @@ class MChanstats : public Module SQL::Query query; Anope::string SmileysHappy, SmileysSad, SmileysOther, prefix; std::vector<Anope::string> TableList, ProcedureList, EventList; + bool NSDefChanstats, CSDefChanstats; void RunQuery(const SQL::Query &q) { @@ -490,7 +491,8 @@ class MChanstats : public Module SmileysHappy = block->Get<const Anope::string>("SmileysHappy"); SmileysSad = block->Get<const Anope::string>("SmileysSad"); SmileysOther = block->Get<const Anope::string>("SmileysOther"); - + NSDefChanstats = block->Get<bool>("NSDefChanstats", "no"); + CSDefChanstats = block->Get<bool>("CSDefChanstats", "no"); Anope::string engine = block->Get<const Anope::string>("engine"); this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine); if (sql) @@ -629,6 +631,18 @@ class MChanstats : public Module query.SetValue("channel", ci->name); this->RunQuery(query); } + + void OnChanRegistered(ChannelInfo *ci) + { + if (CSDefChanstats) + ci->Extend<bool>("CS_STATS"); + } + + void OnNickRegister(User *user, NickAlias *na) + { + if (NSDefChanstats) + na->nc->Extend<bool>("NS_STATS"); + } }; MODULE_INIT(MChanstats) |