diff options
| author | Adam <Adam@anope.org> | 2013-01-21 22:31:16 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-01-21 22:31:16 -0500 |
| commit | ddaa001dafb5122e6e363e4acbbe6ce045b7b104 (patch) | |
| tree | 0364a76606ac6e2881ebd663601ce260f7c1101e /modules/extra/m_chanstats.cpp | |
| parent | 51c049e1a738e9124bab3961f35b830906517421 (diff) | |
Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums
Diffstat (limited to 'modules/extra/m_chanstats.cpp')
| -rw-r--r-- | modules/extra/m_chanstats.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/extra/m_chanstats.cpp b/modules/extra/m_chanstats.cpp index 7096b39a5..3c964b55c 100644 --- a/modules/extra/m_chanstats.cpp +++ b/modules/extra/m_chanstats.cpp @@ -56,7 +56,7 @@ class MChanstats : public Module const Anope::string GetDisplay(User *u) { - if (u && u->Account() && u->Account()->HasFlag(NI_STATS)) + if (u && u->Account() && u->Account()->HasExt("STATS")) return u->Account()->display; else return ""; @@ -350,6 +350,7 @@ class MChanstats : public Module ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); this->OnReload(); } + void OnReload() anope_override { ConfigReader config; @@ -365,30 +366,34 @@ class MChanstats : public Module else Log(this) << "no database connection to " << engine; } + void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) anope_override { User *u = User::Find(user); - if (!u || !u->Account() || !c->ci || !c->ci->HasFlag(CI_STATS)) + if (!u || !u->Account() || !c->ci || !c->ci->HasExt("STATS")) 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)); this->RunQuery(query); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelModeName Name, const Anope::string ¶m) anope_override + + EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, const Anope::string &, const Anope::string ¶m) anope_override { this->OnModeChange(c, setter.GetUser()); return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelModeName Name, const Anope::string ¶m) anope_override + + EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, const Anope::string &, const Anope::string ¶m) anope_override { this->OnModeChange(c, setter.GetUser()); return EVENT_CONTINUE; } + private: void OnModeChange(Channel *c, User *u) { - if (!u || !u->Account() || !c->ci || !c->ci->HasFlag(CI_STATS)) + if (!u || !u->Account() || !c->ci || !c->ci->HasExt("STATS")) return; query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);"; @@ -399,7 +404,7 @@ class MChanstats : public Module public: void OnUserKicked(Channel *c, User *target, MessageSource &source, const Anope::string &kickmsg) anope_override { - if (!c->ci || !c->ci->HasFlag(CI_STATS)) + if (!c->ci || !c->ci->HasExt("STATS")) return; query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0);"; @@ -414,7 +419,7 @@ class MChanstats : public Module } void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override { - if (!c->ci || !c->ci->HasFlag(CI_STATS) || (msg[0] == Config->BSFantasyCharacter[0])) + if (!c->ci || !c->ci->HasExt("STATS") || (msg[0] == Config->BSFantasyCharacter[0])) return; size_t letters = msg.length(); |
