summaryrefslogtreecommitdiff
path: root/modules/stats/cs_fantasy_top.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2013-12-01 12:08:51 +0100
committerDukePyrolator <DukePyrolator@anope.org>2013-12-01 12:09:34 +0100
commitc6f85b9312decba0bbcf5dcba4b801a4aab29b56 (patch)
tree22c7c24b9a301916e52700364cd30047ecef29db /modules/stats/cs_fantasy_top.cpp
parent5e4d52ad4717fb07dde629902beb70c252c8c8b4 (diff)
made the chanstats fantasy modules work again.
Diffstat (limited to 'modules/stats/cs_fantasy_top.cpp')
-rw-r--r--modules/stats/cs_fantasy_top.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/modules/stats/cs_fantasy_top.cpp b/modules/stats/cs_fantasy_top.cpp
index bc08c4c9d..d9f07982a 100644
--- a/modules/stats/cs_fantasy_top.cpp
+++ b/modules/stats/cs_fantasy_top.cpp
@@ -100,10 +100,10 @@ class CSTop : public Module
void OnReload(Configuration::Conf *conf) anope_override
{
- prefix = conf->GetModule(this)->Get<const Anope::string>("prefix");
+ prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix");
if (prefix.empty())
prefix = "anope_";
- this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule(this)->Get<const Anope::string>("engine"));
+ this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<const Anope::string>("engine"));
}
SQL::Result RunQuery(const SQL::Query &query)
@@ -119,19 +119,15 @@ class CSTop : public Module
void DoTop(CommandSource &source, const std::vector<Anope::string> &params, bool is_global, int limit = 1)
{
- if (!source.c || !source.c->ci)
- return;
Anope::string channel;
- if (is_global || params.empty())
- channel = source.c->ci->name;
- else if (!params.empty())
+ if (!params.empty())
channel = params[0];
- else
- {
- source.Reply(_("%s not found."), params[0].c_str());
- return;
- }
+ else if (source.c && source.c->ci)
+ channel = source.c->ci->name;
+
+ if (!is_global && channel.empty())
+ is_global = true;
try
{