1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 22:43:12 +02:00

made the chanstats fantasy modules work again.

This commit is contained in:
DukePyrolator
2013-12-01 12:08:51 +01:00
parent 5e4d52ad47
commit c6f85b9312
4 changed files with 55 additions and 29 deletions
+8 -12
View File
@@ -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
{