summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-06 07:40:43 -0400
committerAdam <Adam@anope.org>2013-05-06 07:40:43 -0400
commitef06226521d27de88a49a84d8224568fec7624c3 (patch)
treeac67340c29521150bbcedc995ffeb7058366fe5e /modules
parent4c669b947ff090f50fef379cfc1b2cad08ecc486 (diff)
Update the rest of modules.example.conf, default inspircd status modes to a sane rank incase they are prefixless, and 50 other things
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/cs_suspend.cpp2
-rw-r--r--modules/commands/os_forbid.cpp4
-rw-r--r--modules/extra/m_httpd.cpp3
-rw-r--r--modules/extra/m_ldap.cpp22
-rw-r--r--modules/extra/m_ldap_authentication.cpp4
-rw-r--r--modules/extra/m_mysql.cpp4
-rw-r--r--modules/extra/m_proxyscan.cpp4
-rw-r--r--modules/extra/m_xmlrpc.cpp5
-rw-r--r--modules/m_dnsbl.cpp4
-rw-r--r--modules/protocol/inspircd20.cpp10
-rw-r--r--modules/pseudoclients/chanserv.cpp2
11 files changed, 36 insertions, 28 deletions
diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp
index a26cbacd5..5fc6fe287 100644
--- a/modules/commands/cs_suspend.cpp
+++ b/modules/commands/cs_suspend.cpp
@@ -19,7 +19,7 @@ class CommandCSSuspend : public Command
CommandCSSuspend(Module *creator) : Command(creator, "chanserv/suspend", 1, 3)
{
this->SetDesc(_("Prevent a channel from being used preserving channel data and settings"));
- this->SetSyntax(_("\037channel\037 [+\037expiry\037] [\037reason\037]"));
+ this->SetSyntax(_("\037channel\037 [+\037expiry\037] \037reason\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp
index 6cc00edda..c7c147c7e 100644
--- a/modules/commands/os_forbid.cpp
+++ b/modules/commands/os_forbid.cpp
@@ -14,8 +14,6 @@
#include "module.h"
#include "modules/os_forbid.h"
-static ServiceReference<NickServService> nickserv("NickServService", "NickServ");
-
class MyForbidService : public ForbidService
{
Serialize::Checker<std::vector<ForbidData *>[FT_SIZE - 1]> forbid_data;
@@ -87,7 +85,7 @@ class CommandOSForbid : public Command
CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5), fs("ForbidService", "forbid")
{
this->SetDesc(_("Forbid usage of nicknames, channels, and emails"));
- this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037\002 [\037reason\037]"));
+ this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037\002 \037reason\037"));
this->SetSyntax(_("DEL {NICK|CHAN|EMAIL|REGISTER} \037entry\037"));
this->SetSyntax(_("LIST (NICK|CHAN|EMAIL|REGISTER)"));
}
diff --git a/modules/extra/m_httpd.cpp b/modules/extra/m_httpd.cpp
index 5a4260149..212abfa4f 100644
--- a/modules/extra/m_httpd.cpp
+++ b/modules/extra/m_httpd.cpp
@@ -352,8 +352,9 @@ class HTTPD : public Module
this->providers.clear();
}
- void OnReload(Configuration::Conf *conf) anope_override
+ void OnReload(Configuration::Conf *config) anope_override
{
+ Configuration::Block *conf = config->GetModule(this);
std::set<Anope::string> existing;
for (int i = 0; i < conf->CountBlock("httpd"); ++i)
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp
index 4168193a3..17ad60213 100644
--- a/modules/extra/m_ldap.cpp
+++ b/modules/extra/m_ldap.cpp
@@ -423,7 +423,7 @@ class ModuleLDAP : public Module, public Pipe
LDAPServices.clear();
}
- void OnReload(Configuration::Conf *conf) anope_override
+ void OnReload(Configuration::Conf *config) anope_override
{
int i, num;
@@ -433,8 +433,9 @@ class ModuleLDAP : public Module, public Pipe
LDAPService *s = it->second;
++it;
- for (i = 0; i < Config->CountBlock("ldap"); ++i)
- if (Config->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname)
+ Configuration::Block *conf = Config->GetModule(this);
+ for (i = 0; i < conf->CountBlock("ldap"); ++i)
+ if (conf->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname)
break;
if (i == num)
@@ -447,16 +448,19 @@ class ModuleLDAP : public Module, public Pipe
}
}
- for (i = 0; i < Config->CountBlock("ldap"); ++i)
+ Configuration::Block *conf = config->GetModule(this);
+ for (i = 0; i < conf->CountBlock("ldap"); ++i)
{
- const Anope::string &connname = Config->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main");
+ Configuration::Block *ldap = conf->GetBlock("ldap", i);
+
+ const Anope::string &connname = ldap->Get<const Anope::string>("name", "ldap/main");
if (this->LDAPServices.find(connname) == this->LDAPServices.end())
{
- const Anope::string &server = Config->GetBlock("ldap", i)->Get<const Anope::string>("server", "127.0.0.1");
- int port = Config->GetBlock("ldap", i)->Get<int>("port", "389");
- const Anope::string &admin_binddn = Config->GetBlock("ldap", i)->Get<const Anope::string>("admin_binddn");
- const Anope::string &admin_password = Config->GetBlock("ldap", i)->Get<const Anope::string>("admin_password");
+ const Anope::string &server = ldap->Get<const Anope::string>("server", "127.0.0.1");
+ int port = ldap->Get<int>("port", "389");
+ const Anope::string &admin_binddn = ldap->Get<const Anope::string>("admin_binddn");
+ const Anope::string &admin_password = ldap->Get<const Anope::string>("admin_password");
try
{
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp
index 4bd76ff09..08f070bb8 100644
--- a/modules/extra/m_ldap_authentication.cpp
+++ b/modules/extra/m_ldap_authentication.cpp
@@ -220,9 +220,9 @@ class NSIdentifyLDAP : public Module
ModuleManager::SetPriority(this, PRIORITY_FIRST);
}
- void OnReload(Configuration::Conf *conf) anope_override
+ void OnReload(Configuration::Conf *config) anope_override
{
- Configuration::Block *config = Config->GetModule(this);
+ Configuration::Block *conf = Config->GetModule(this);
basedn = conf->Get<const Anope::string>("basedn");
search_filter = conf->Get<const Anope::string>("search_filter");
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp
index a61f11e8b..8cf12ca79 100644
--- a/modules/extra/m_mysql.cpp
+++ b/modules/extra/m_mysql.cpp
@@ -212,9 +212,9 @@ class ModuleSQL : public Module, public Pipe
}
}
- for (i = 0; i < Config->CountBlock("mysql"); ++i)
+ for (i = 0; i < config->CountBlock("mysql"); ++i)
{
- Configuration::Block *block = Config->GetBlock("mysql", i);
+ Configuration::Block *block = config->GetBlock("mysql", i);
const Anope::string &connname = block->Get<const Anope::string>("name", "mysql/main");
if (this->MySQLServices.find(connname) == this->MySQLServices.end())
diff --git a/modules/extra/m_proxyscan.cpp b/modules/extra/m_proxyscan.cpp
index 075f9067e..da2ab5692 100644
--- a/modules/extra/m_proxyscan.cpp
+++ b/modules/extra/m_proxyscan.cpp
@@ -295,9 +295,9 @@ class ModuleProxyScan : public Module
}
this->proxyscans.clear();
- for (int i = 0; i < conf->CountBlock("proxyscan"); ++i)
+ for (int i = 0; i < config->CountBlock("proxyscan"); ++i)
{
- Configuration::Block *block = conf->GetBlock("proxyscan", i);
+ Configuration::Block *block = config->GetBlock("proxyscan", i);
ProxyCheck p;
Anope::string token;
diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp
index c1a9bc1d5..66e2db9ac 100644
--- a/modules/extra/m_xmlrpc.cpp
+++ b/modules/extra/m_xmlrpc.cpp
@@ -177,6 +177,11 @@ class ModuleXMLRPC : public Module
if (httpref)
httpref->UnregisterPage(&xmlrpcinterface);
}
+
+ void OnReload(Configuration::Conf *conf) anope_override
+ {
+ this->httpref = ServiceReference<HTTPProvider>("HTTPProvider", conf->GetModule(this)->Get<const Anope::string>("server", "httpd/main"));
+ }
};
MODULE_INIT(ModuleXMLRPC)
diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp
index b6ebcfb55..ea1f1d9f6 100644
--- a/modules/m_dnsbl.cpp
+++ b/modules/m_dnsbl.cpp
@@ -103,9 +103,9 @@ class ModuleDNSBL : public Module
this->add_to_akill = block->Get<bool>("add_to_akill", "yes");
this->blacklists.clear();
- for (int i = 0, num = conf->CountBlock("blacklist"); i < num; ++i)
+ for (int i = 0, num = block->CountBlock("blacklist"); i < num; ++i)
{
- Configuration::Block *bl = conf->GetBlock("blacklist", i);
+ Configuration::Block *bl = block->GetBlock("blacklist", i);
Anope::string bname = bl->Get<const Anope::string>("name");
if (bname.empty())
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 702bf6eea..3998486e3 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -300,7 +300,7 @@ struct IRCDMessageCapab : Message::Capab
ChannelMode *cm = NULL;
if (modename.equals_cs("admin"))
- cm = new ChannelModeStatus("PROTECT", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("PROTECT", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 3);
else if (modename.equals_cs("allowinvite"))
cm = new ChannelMode("ALLINVITE", modechar[0]);
else if (modename.equals_cs("auditorium"))
@@ -326,9 +326,9 @@ struct IRCDMessageCapab : Message::Capab
else if (modename.equals_cs("flood"))
cm = new ChannelModeFlood(modechar[0]);
else if (modename.equals_cs("founder"))
- cm = new ChannelModeStatus("OWNER", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("OWNER", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 4);
else if (modename.equals_cs("halfop"))
- cm = new ChannelModeStatus("HALFOP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("HALFOP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 1);
else if (modename.equals_cs("history"))
cm = new ChannelModeHistory(modechar[0]);
else if (modename.equals_cs("invex"))
@@ -360,7 +360,7 @@ struct IRCDMessageCapab : Message::Capab
else if (modename.equals_cs("nonotice"))
cm = new ChannelMode("NONOTICE", modechar[0]);
else if (modename.equals_cs("op"))
- cm = new ChannelModeStatus("OP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("OP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 2);
else if (modename.equals_cs("operonly"))
cm = new ChannelModeOper(modechar[0]);
else if (modename.equals_cs("permanent"))
@@ -382,7 +382,7 @@ struct IRCDMessageCapab : Message::Capab
else if (modename.equals_cs("topiclock"))
cm = new ChannelMode("TOPIC", modechar[0]);
else if (modename.equals_cs("voice"))
- cm = new ChannelModeStatus("VOICE", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("VOICE", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 0);
/* Unknown status mode, (customprefix) - add it */
else if (modechar.length() == 2)
cm = new ChannelModeStatus(modename.upper(), modechar[1], modechar[0]);
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp
index a93271581..73980a36a 100644
--- a/modules/pseudoclients/chanserv.cpp
+++ b/modules/pseudoclients/chanserv.cpp
@@ -82,7 +82,7 @@ class MyChanServService : public ChanServService
/** Constructor
* @param chan The channel
*/
- ChanServTimer(Module *m, Channel *chan) : Timer(m, Config->GetModule(this->GetOwner())->Get<time_t>("inhabit", "15s")), c(chan)
+ ChanServTimer(Module *m, Channel *chan) : Timer(m, Config->GetModule(m)->Get<time_t>("inhabit", "15s")), c(chan)
{
if (!ChanServ || !c)
return;