mirror of
https://github.com/anope/anope.git
synced 2026-06-12 19:14:47 +02:00
Remove some duplicate chanstats settings.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
/*
|
||||
* Example configuration file for Chanstats.
|
||||
*
|
||||
* You can enable Chanstats by default by adding CS_STATS to {chanserv}:defaults
|
||||
* and NS_STATS to {nickserv}:defaults.
|
||||
*
|
||||
* Make sure BotServ, ChanServ and NickServ are running.
|
||||
*/
|
||||
|
||||
@@ -23,12 +27,6 @@ module
|
||||
smileyshappy = ":) :-) ;) ;-) :D :-D :P :-P"
|
||||
smileyssad = ":( :-( ;( ;-("
|
||||
smileysother = ":/ :-/"
|
||||
|
||||
/*
|
||||
* Enable Chanstats for newly registered nicks / channels.
|
||||
*/
|
||||
ns_def_chanstats = yes
|
||||
cs_def_chanstats = yes
|
||||
}
|
||||
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
|
||||
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
|
||||
|
||||
@@ -181,7 +181,6 @@ class MChanstats final
|
||||
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)
|
||||
{
|
||||
@@ -504,8 +503,6 @@ public:
|
||||
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>("ns_def_chanstats");
|
||||
CSDefChanstats = block.Get<bool>("cs_def_chanstats");
|
||||
Anope::string engine = block.Get<const Anope::string>("engine");
|
||||
this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine);
|
||||
if (sql)
|
||||
@@ -643,18 +640,6 @@ public:
|
||||
query.SetValue("channel", ci->name);
|
||||
this->RunQuery(query);
|
||||
}
|
||||
|
||||
void OnChanRegistered(ChannelInfo *ci) override
|
||||
{
|
||||
if (CSDefChanstats)
|
||||
ci->Extend<bool>("CS_STATS");
|
||||
}
|
||||
|
||||
void OnNickRegister(User *user, NickAlias *na, const Anope::string &) override
|
||||
{
|
||||
if (NSDefChanstats)
|
||||
na->nc->Extend<bool>("NS_STATS");
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(MChanstats)
|
||||
|
||||
Reference in New Issue
Block a user