mirror of
https://github.com/anope/anope.git
synced 2026-07-04 06:23:14 +02:00
That doesn't work either, just don't use references.
find ./ -name '*.cpp' -exec sed -i 's/Get<const Anope::string\&>/Get<const Anope::string>/g' {} \;
This commit is contained in:
@@ -20,7 +20,7 @@ class BSAutoAssign : public Module
|
||||
|
||||
void OnChanRegistered(ChannelInfo *ci) anope_override
|
||||
{
|
||||
const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string &>("bot");
|
||||
const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string>("bot");
|
||||
if (bot.empty())
|
||||
return;
|
||||
|
||||
|
||||
@@ -801,13 +801,13 @@ class CSAccess : public Module
|
||||
{
|
||||
Configuration::Block *priv = conf->GetBlock("privilege", i);
|
||||
|
||||
const Anope::string &pname = priv->Get<const Anope::string &>("name");
|
||||
const Anope::string &pname = priv->Get<const Anope::string>("name");
|
||||
|
||||
Privilege *p = PrivilegeManager::FindPrivilege(pname);
|
||||
if (p == NULL)
|
||||
continue;
|
||||
|
||||
const Anope::string &value = priv->Get<const Anope::string &>("level");
|
||||
const Anope::string &value = priv->Get<const Anope::string>("level");
|
||||
if (value.empty())
|
||||
continue;
|
||||
else if (value.equals_ci("founder"))
|
||||
|
||||
@@ -546,7 +546,7 @@ class CSAKick : public Module
|
||||
mask = autokick->mask;
|
||||
reason = autokick->reason;
|
||||
if (reason.empty())
|
||||
reason = Config->GetModule(this)->Get<const Anope::string &>("autokickreason");
|
||||
reason = Config->GetModule(this)->Get<const Anope::string>("autokickreason");
|
||||
if (reason.empty())
|
||||
reason = "User has been banned from the channel";
|
||||
return EVENT_STOP;
|
||||
|
||||
@@ -79,10 +79,10 @@ class CSStats : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
prefix = conf->GetModule(this)->Get<const Anope::string &>("prefix");
|
||||
prefix = conf->GetModule(this)->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(this)->Get<const Anope::string>("engine"));
|
||||
}
|
||||
|
||||
SQL::Result RunQuery(const SQL::Query &query)
|
||||
|
||||
@@ -104,10 +104,10 @@ class CSTop : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
prefix = conf->GetModule(this)->Get<const Anope::string &>("prefix");
|
||||
prefix = conf->GetModule(this)->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(this)->Get<const Anope::string>("engine"));
|
||||
}
|
||||
|
||||
SQL::Result RunQuery(const SQL::Query &query)
|
||||
|
||||
@@ -406,13 +406,13 @@ class CSFlags : public Module
|
||||
{
|
||||
Configuration::Block *priv = conf->GetBlock("privilege", i);
|
||||
|
||||
const Anope::string &pname = priv->Get<const Anope::string &>("name");
|
||||
const Anope::string &pname = priv->Get<const Anope::string>("name");
|
||||
|
||||
Privilege *p = PrivilegeManager::FindPrivilege(pname);
|
||||
if (p == NULL)
|
||||
continue;
|
||||
|
||||
const Anope::string &value = priv->Get<const Anope::string &>("flag");
|
||||
const Anope::string &value = priv->Get<const Anope::string>("flag");
|
||||
if (value.empty())
|
||||
continue;
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class CommandCSList : public Command
|
||||
" \002LIST #51-100\002\n"
|
||||
" Lists all registered channels within the given range (51-100)."));
|
||||
|
||||
if (!Config->GetBlock("options")->Get<const Anope::string &>("regexengine").empty())
|
||||
if (!Config->GetBlock("options")->Get<const Anope::string>("regexengine").empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Regex matches are also supported using the %s engine.\n"
|
||||
|
||||
@@ -150,11 +150,11 @@ class CSSetMisc : public Module
|
||||
{
|
||||
Configuration::Block *block = conf->GetBlock("command", i);
|
||||
|
||||
if (block->Get<const Anope::string &>("command") != "chanserv/set/misc")
|
||||
if (block->Get<const Anope::string>("command") != "chanserv/set/misc")
|
||||
continue;
|
||||
|
||||
Anope::string cname = block->Get<const Anope::string &>("name");
|
||||
Anope::string desc = block->Get<const Anope::string &>("misc_description");
|
||||
Anope::string cname = block->Get<const Anope::string>("name");
|
||||
Anope::string desc = block->Get<const Anope::string>("misc_description");
|
||||
|
||||
if (cname.empty() || desc.empty())
|
||||
continue;
|
||||
|
||||
@@ -557,13 +557,13 @@ class CSXOP : public Module
|
||||
for (int i = 0; i < conf->CountBlock("privilege"); ++i)
|
||||
{
|
||||
Configuration::Block *block = conf->GetBlock("privilege", i);
|
||||
const Anope::string &pname = block->Get<const Anope::string &>("name");
|
||||
const Anope::string &pname = block->Get<const Anope::string>("name");
|
||||
|
||||
Privilege *p = PrivilegeManager::FindPrivilege(pname);
|
||||
if (p == NULL)
|
||||
continue;
|
||||
|
||||
const Anope::string &xop = block->Get<const Anope::string &>("xop");
|
||||
const Anope::string &xop = block->Get<const Anope::string>("xop");
|
||||
if (pname.empty() || xop.empty())
|
||||
continue;
|
||||
|
||||
@@ -573,8 +573,8 @@ class CSXOP : public Module
|
||||
for (int i = 0; i < conf->CountBlock("command"); ++i)
|
||||
{
|
||||
Configuration::Block *block = conf->GetBlock("command", i);
|
||||
const Anope::string &cname = block->Get<const Anope::string &>("name"),
|
||||
&cserv = block->Get<const Anope::string &>("command");
|
||||
const Anope::string &cname = block->Get<const Anope::string>("name"),
|
||||
&cserv = block->Get<const Anope::string>("command");
|
||||
if (cname.empty() || cserv != "chanserv/xop")
|
||||
continue;
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class CommandNSGroup : public Command
|
||||
}
|
||||
|
||||
NickAlias *target, *na = NickAlias::Find(u->nick);
|
||||
const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string &>("guestnickprefix");
|
||||
const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string>("guestnickprefix");
|
||||
time_t reg_delay = Config->GetModule("nickserv")->Get<time_t>("regdelay");
|
||||
if (!(target = NickAlias::Find(nick)))
|
||||
source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
|
||||
|
||||
@@ -167,7 +167,7 @@ class CommandNSList : public Command
|
||||
" \002LIST #51-100\002\n"
|
||||
" Lists all registered nicks within the given range (51-100)."));
|
||||
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
|
||||
@@ -116,7 +116,7 @@ class CommandNSRegister : public Command
|
||||
size_t nicklen = u_nick.length();
|
||||
Anope::string pass = params[0];
|
||||
Anope::string email = params.size() > 1 ? params[1] : "";
|
||||
const Anope::string &nsregister = Config->GetModule(this->owner)->Get<const Anope::string &>("registration");
|
||||
const Anope::string &nsregister = Config->GetModule(this->owner)->Get<const Anope::string>("registration");
|
||||
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
@@ -143,7 +143,7 @@ class CommandNSRegister : public Command
|
||||
/* Guest nick can now have a series of between 1 and 7 digits.
|
||||
* --lara
|
||||
*/
|
||||
const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string &>("guestnickprefix");
|
||||
const Anope::string &guestnick = Config->GetBlock("options")->Get<const Anope::string>("guestnickprefix");
|
||||
if (nicklen <= guestnick.length() + 7 && nicklen >= guestnick.length() + 1 && !u_nick.find_ci(guestnick) && u_nick.substr(guestnick.length()).find_first_not_of("1234567890") == Anope::string::npos)
|
||||
{
|
||||
source.Reply(NICK_CANNOT_BE_REGISTERED, u_nick.c_str());
|
||||
@@ -290,7 +290,7 @@ class CommandNSResend : public Command
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
if (!Config->GetModule(this->owner)->Get<const Anope::string &>("registration").equals_ci("mail"))
|
||||
if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail"))
|
||||
return;
|
||||
|
||||
const NickAlias *na = NickAlias::Find(source.GetNick());
|
||||
@@ -318,7 +318,7 @@ class CommandNSResend : public Command
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
|
||||
{
|
||||
if (!Config->GetModule(this->owner)->Get<const Anope::string &>("registration").equals_ci("mail"))
|
||||
if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail"))
|
||||
return false;
|
||||
|
||||
this->SendSyntax(source);
|
||||
@@ -330,7 +330,7 @@ class CommandNSResend : public Command
|
||||
|
||||
void OnServHelp(CommandSource &source) anope_override
|
||||
{
|
||||
if (Config->GetModule(this->owner)->Get<const Anope::string &>("registration").equals_ci("mail"))
|
||||
if (Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail"))
|
||||
Command::OnServHelp(source);
|
||||
}
|
||||
};
|
||||
@@ -345,7 +345,7 @@ class NSRegister : public Module
|
||||
NSRegister(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
||||
commandnsregister(this), commandnsconfirm(this), commandnsrsend(this)
|
||||
{
|
||||
if (Config->GetModule(this)->Get<const Anope::string &>("registration").equals_ci("disable"))
|
||||
if (Config->GetModule(this)->Get<const Anope::string>("registration").equals_ci("disable"))
|
||||
throw ModuleException("Module " + this->name + " will not load with registration disabled.");
|
||||
}
|
||||
};
|
||||
@@ -377,11 +377,11 @@ static bool SendRegmail(User *u, const NickAlias *na, const BotInfo *bi)
|
||||
message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("registration_message"));
|
||||
|
||||
subject = subject.replace_all_cs("%n", na->nick);
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
subject = subject.replace_all_cs("%c", codebuf);
|
||||
|
||||
message = message.replace_all_cs("%n", na->nick);
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
message = message.replace_all_cs("%c", codebuf);
|
||||
|
||||
return Mail::Send(u, nc, bi, subject, message);
|
||||
|
||||
@@ -143,11 +143,11 @@ static bool SendResetEmail(User *u, const NickAlias *na, const BotInfo *bi)
|
||||
message = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const char *>("reset_message"));
|
||||
|
||||
subject = subject.replace_all_cs("%n", na->nick);
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
subject = subject.replace_all_cs("%c", passcode);
|
||||
|
||||
message = message.replace_all_cs("%n", na->nick);
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
message = message.replace_all_cs("%c", passcode);
|
||||
|
||||
ResetInfo *ri = new ResetInfo;
|
||||
|
||||
@@ -468,11 +468,11 @@ class CommandNSSetEmail : public Command
|
||||
message = Config->GetBlock("mail")->Get<const char *>("emailchange_message");
|
||||
|
||||
subject = subject.replace_all_cs("%e", u->Account()->email);
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
subject = subject.replace_all_cs("%c", code);
|
||||
|
||||
message = message.replace_all_cs("%e", u->Account()->email);
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
message = message.replace_all_cs("%c", code);
|
||||
|
||||
return Mail::Send(u, u->Account(), bi, subject, message);
|
||||
|
||||
@@ -169,13 +169,13 @@ class NSSetMisc : public Module
|
||||
{
|
||||
Configuration::Block *block = conf->GetBlock("command", i);
|
||||
|
||||
const Anope::string &cmd = block->Get<const Anope::string &>("command");
|
||||
const Anope::string &cmd = block->Get<const Anope::string>("command");
|
||||
|
||||
if (cmd != "nickserv/set/misc" && cmd != "nickserv/saset/misc")
|
||||
continue;
|
||||
|
||||
Anope::string cname = block->Get<const Anope::string &>("name");
|
||||
Anope::string desc = block->Get<const Anope::string &>("misc_description");
|
||||
Anope::string cname = block->Get<const Anope::string>("name");
|
||||
Anope::string desc = block->Get<const Anope::string>("misc_description");
|
||||
|
||||
if (cname.empty() || desc.empty())
|
||||
continue;
|
||||
|
||||
@@ -121,7 +121,7 @@ class CommandOSAKill : public Command
|
||||
|
||||
if (mask[0] == '/' && mask[mask.length() - 1] == '/')
|
||||
{
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
|
||||
if (regexengine.empty())
|
||||
{
|
||||
@@ -419,7 +419,7 @@ class CommandOSAKill : public Command
|
||||
"be given, even if it is the same as the default. The\n"
|
||||
"current AKILL default expiry time can be found with the\n"
|
||||
"\002STATS AKILL\002 command."));
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
|
||||
@@ -345,26 +345,26 @@ class OSDefcon : public Module
|
||||
DefconConfig dconfig;
|
||||
|
||||
dconfig.defaultlevel = block->Get<int>("defaultlevel");
|
||||
dconfig.defcons[4] = block->Get<const Anope::string &>("level4");
|
||||
dconfig.defcons[3] = block->Get<const Anope::string &>("level3");
|
||||
dconfig.defcons[2] = block->Get<const Anope::string &>("level2");
|
||||
dconfig.defcons[1] = block->Get<const Anope::string &>("level1");
|
||||
dconfig.defcons[4] = block->Get<const Anope::string>("level4");
|
||||
dconfig.defcons[3] = block->Get<const Anope::string>("level3");
|
||||
dconfig.defcons[2] = block->Get<const Anope::string>("level2");
|
||||
dconfig.defcons[1] = block->Get<const Anope::string>("level1");
|
||||
dconfig.sessionlimit = block->Get<int>("sessionlimit");
|
||||
dconfig.akillreason = block->Get<const Anope::string &>("akillreason");
|
||||
dconfig.akillreason = block->Get<const Anope::string>("akillreason");
|
||||
dconfig.akillexpire = block->Get<time_t>("akillexpire");
|
||||
dconfig.chanmodes = block->Get<const Anope::string &>("chanmodes");
|
||||
dconfig.chanmodes = block->Get<const Anope::string>("chanmodes");
|
||||
dconfig.timeout = block->Get<time_t>("timeout");
|
||||
dconfig.globalondefcon = block->Get<bool>("globalondefcon");
|
||||
dconfig.message = block->Get<const Anope::string &>("message");
|
||||
dconfig.offmessage = block->Get<const Anope::string &>("offmessage");
|
||||
dconfig.message = block->Get<const Anope::string>("message");
|
||||
dconfig.offmessage = block->Get<const Anope::string>("offmessage");
|
||||
|
||||
Module *session = ModuleManager::FindModule("os_session");
|
||||
block = conf->GetModule(session);
|
||||
|
||||
dconfig.max_session_kill = block->Get<int>("maxsessionkill");
|
||||
dconfig.session_autokill_expiry = block->Get<time_t>("sessionautokillexpiry");
|
||||
dconfig.sle_reason = block->Get<const Anope::string &>("sessionlimitexceeded");
|
||||
dconfig.sle_detailsloc = block->Get<const Anope::string &>("sessionlimitdetailsloc");
|
||||
dconfig.sle_reason = block->Get<const Anope::string>("sessionlimitexceeded");
|
||||
dconfig.sle_detailsloc = block->Get<const Anope::string>("sessionlimitdetailsloc");
|
||||
|
||||
if (dconfig.defaultlevel < 1 || dconfig.defaultlevel > 5)
|
||||
throw ConfigException("The value for <defcon:defaultlevel> must be between 1 and 5");
|
||||
|
||||
@@ -230,7 +230,7 @@ class CommandOSForbid : public Command
|
||||
source.Reply(_("Forbid allows you to forbid usage of certain nicknames, channels,\n"
|
||||
"and email addresses. Wildcards are accepted for all entries."));
|
||||
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
|
||||
@@ -299,7 +299,7 @@ class CommandOSIgnore : public Command
|
||||
" \n"
|
||||
"Ignores will not be enforced on IRC Operators."));
|
||||
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
|
||||
@@ -103,7 +103,7 @@ class CommandOSChanList : public Command
|
||||
"specified, lists only channels matching \002pattern\002 that have the +s or\n"
|
||||
"+p mode."));
|
||||
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
@@ -209,7 +209,7 @@ class CommandOSUserList : public Command
|
||||
"that are on the given channel. If INVISIBLE is specified, only users\n"
|
||||
"with the +i flag will be listed."));
|
||||
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
|
||||
@@ -89,7 +89,7 @@ class CommandOSLogSearch : public Command
|
||||
|
||||
Log(LOG_ADMIN, source, this) << "for " << search_string;
|
||||
|
||||
const Anope::string &logfile_name = Config->GetModule(this->owner)->Get<const Anope::string &>("logname");
|
||||
const Anope::string &logfile_name = Config->GetModule(this->owner)->Get<const Anope::string>("logname");
|
||||
std::list<Anope::string> matches;
|
||||
for (int d = days - 1; d >= 0; --d)
|
||||
{
|
||||
|
||||
@@ -652,8 +652,8 @@ class OSSession : public Module
|
||||
session_limit = block->Get<int>("defaultsessionlimit");
|
||||
max_session_kill = block->Get<int>("maxsessionkill");
|
||||
session_autokill_expiry = block->Get<time_t>("sessionautokillexpiry");
|
||||
sle_reason = block->Get<const Anope::string &>("sessionlimitexceeded");
|
||||
sle_detailsloc = block->Get<const Anope::string &>("sessionlimitdetailsloc");
|
||||
sle_reason = block->Get<const Anope::string>("sessionlimitexceeded");
|
||||
sle_detailsloc = block->Get<const Anope::string>("sessionlimitdetailsloc");
|
||||
|
||||
max_exception_limit = block->Get<int>("maxsessionlimit");
|
||||
exception_expiry = block->Get<time_t>("exceptionexpiry");
|
||||
|
||||
@@ -311,7 +311,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
|
||||
|
||||
if (mask[0] == '/' && mask[mask.length() - 1] == '/')
|
||||
{
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
|
||||
if (regexengine.empty())
|
||||
{
|
||||
@@ -438,7 +438,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
|
||||
"\002STATS AKILL\002 command.\n"
|
||||
"Note: because the realname mask may contain spaces, the\n"
|
||||
"separator between it and the reason is a colon."));
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
@@ -527,7 +527,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
|
||||
|
||||
if (mask[0] == '/' && mask[mask.length() - 1] == '/')
|
||||
{
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
|
||||
if (regexengine.empty())
|
||||
{
|
||||
@@ -674,7 +674,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
|
||||
"must be given, even if it is the same as the default. The\n"
|
||||
"current SQLINE default expiry time can be found with the\n"
|
||||
"\002STATS AKILL\002 command."));
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty())
|
||||
{
|
||||
source.Reply(" ");
|
||||
|
||||
@@ -119,7 +119,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder();
|
||||
|
||||
std::set<Anope::string> dbs;
|
||||
dbs.insert(Config->GetModule(this)->Get<const Anope::string &>("database"));
|
||||
dbs.insert(Config->GetModule(this)->Get<const Anope::string>("database"));
|
||||
|
||||
for (unsigned i = 0; i < type_order.size(); ++i)
|
||||
{
|
||||
@@ -195,7 +195,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder();
|
||||
std::set<Anope::string> tried_dbs;
|
||||
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database");
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database");
|
||||
|
||||
std::fstream fd(db_name.c_str(), std::ios_base::in);
|
||||
if (!fd.is_open())
|
||||
@@ -272,7 +272,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
if (s_type->GetOwner())
|
||||
db_name = Anope::DataDir + "/module_" + s_type->GetOwner()->name + ".db";
|
||||
else
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database");
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database");
|
||||
|
||||
if (Anope::IsFile(db_name))
|
||||
rename(db_name.c_str(), (db_name + ".tmp").c_str());
|
||||
@@ -304,7 +304,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
for (std::map<Module *, std::fstream *>::iterator it = databases.begin(), it_end = databases.end(); it != it_end; ++it)
|
||||
{
|
||||
std::fstream *f = it->second;
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string &>("database"));
|
||||
const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string>("database"));
|
||||
|
||||
if (!f->is_open() || !f->good())
|
||||
{
|
||||
@@ -349,7 +349,7 @@ class DBFlatFile : public Module, public Pipe
|
||||
if (stype->GetOwner())
|
||||
db_name = Anope::DataDir + "/module_" + stype->GetOwner()->name + ".db";
|
||||
else
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string &>("database");
|
||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database");
|
||||
|
||||
std::fstream fd(db_name.c_str(), std::ios_base::in);
|
||||
if (!fd.is_open())
|
||||
|
||||
@@ -1098,7 +1098,7 @@ class DBOld : public Module
|
||||
Implementation i[] = { I_OnLoadDatabase, I_OnUplinkSync };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
hashm = Config->GetModule(this)->Get<const Anope::string &>("hash");
|
||||
hashm = Config->GetModule(this)->Get<const Anope::string>("hash");
|
||||
|
||||
if (hashm != "md5" && hashm != "oldmd5" && hashm != "sha1" && hashm != "plain" && hashm != "sha256")
|
||||
throw ModuleException("Invalid hash method");
|
||||
|
||||
@@ -637,7 +637,7 @@ class DBPlain : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
DatabaseFile = Anope::DataDir + "/" + conf->GetModule(this)->Get<const Anope::string &>("database");
|
||||
DatabaseFile = Anope::DataDir + "/" + conf->GetModule(this)->Get<const Anope::string>("database");
|
||||
if (DatabaseFile.empty())
|
||||
DatabaseFile = "anope.db";
|
||||
BackupFile = Anope::DataDir + "/backups/" + DatabaseFile;
|
||||
|
||||
@@ -149,8 +149,8 @@ class DBSQL : public Module, public Pipe
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
Configuration::Block *block = conf->GetModule(this);
|
||||
this->sql = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string &>("engine"));
|
||||
this->prefix = block->Get<const Anope::string &>("prefix", "anope_db_");
|
||||
this->sql = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine"));
|
||||
this->prefix = block->Get<const Anope::string>("prefix", "anope_db_");
|
||||
this->import = block->Get<bool>("import");
|
||||
}
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@ class DBMySQL : public Module, public Pipe
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
Configuration::Block *block = conf->GetModule(this);
|
||||
this->SQL = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string &>("engine"));
|
||||
this->prefix = block->Get<const Anope::string &>("prefix", "anope_db_");
|
||||
this->SQL = ServiceReference<Provider>("SQL::Provider", block->Get<const Anope::string>("engine"));
|
||||
this->prefix = block->Get<const Anope::string>("prefix", "anope_db_");
|
||||
}
|
||||
|
||||
void OnSerializableConstruct(Serializable *obj) anope_override
|
||||
|
||||
@@ -352,12 +352,12 @@ class MChanstats : public Module
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
Configuration::Block *block = conf->GetModule(this);
|
||||
prefix = block->Get<const Anope::string &>("prefix", "anope_");
|
||||
SmileysHappy = block->Get<const Anope::string &>("SmileysHappy");
|
||||
SmileysSad = block->Get<const Anope::string &>("SmileysSad");
|
||||
SmileysOther = block->Get<const Anope::string &>("SmileysOther");
|
||||
prefix = block->Get<const Anope::string>("prefix", "anope_");
|
||||
SmileysHappy = block->Get<const Anope::string>("SmileysHappy");
|
||||
SmileysSad = block->Get<const Anope::string>("SmileysSad");
|
||||
SmileysOther = block->Get<const Anope::string>("SmileysOther");
|
||||
|
||||
Anope::string engine = block->Get<const Anope::string &>("engine");
|
||||
Anope::string engine = block->Get<const Anope::string>("engine");
|
||||
this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine);
|
||||
if (sql)
|
||||
this->CheckTables();
|
||||
|
||||
@@ -361,15 +361,15 @@ class HTTPD : public Module
|
||||
Configuration::Block *block = conf->GetBlock("httpd", i);
|
||||
|
||||
|
||||
const Anope::string &hname = block->Get<const Anope::string &>("name", "httpd/main");
|
||||
const Anope::string &hname = block->Get<const Anope::string>("name", "httpd/main");
|
||||
existing.insert(hname);
|
||||
|
||||
Anope::string ip = block->Get<const Anope::string &>("ip");
|
||||
Anope::string ip = block->Get<const Anope::string>("ip");
|
||||
int port = block->Get<int>("port", "8080");
|
||||
int timeout = block->Get<int>("timeout", "30");
|
||||
bool ssl = block->Get<bool>("ssl", "no");
|
||||
Anope::string ext_ip = block->Get<const Anope::string &>("extforward_ip");
|
||||
Anope::string ext_header = block->Get<const Anope::string &>("extforward_header");
|
||||
Anope::string ext_ip = block->Get<const Anope::string>("extforward_ip");
|
||||
Anope::string ext_header = block->Get<const Anope::string>("extforward_header");
|
||||
|
||||
if (ip.empty())
|
||||
{
|
||||
|
||||
@@ -434,7 +434,7 @@ class ModuleLDAP : public Module, public Pipe
|
||||
++it;
|
||||
|
||||
for (i = 0; i < Config->CountBlock("ldap"); ++i)
|
||||
if (Config->GetBlock("ldap", i)->Get<const Anope::string &>("name", "ldap/main") == cname)
|
||||
if (Config->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname)
|
||||
break;
|
||||
|
||||
if (i == num)
|
||||
@@ -449,14 +449,14 @@ class ModuleLDAP : public Module, public Pipe
|
||||
|
||||
for (i = 0; i < Config->CountBlock("ldap"); ++i)
|
||||
{
|
||||
const Anope::string &connname = Config->GetBlock("ldap", i)->Get<const Anope::string &>("name", "ldap/main");
|
||||
const Anope::string &connname = Config->GetBlock("ldap", i)->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");
|
||||
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 &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");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -225,14 +225,14 @@ class NSIdentifyLDAP : public Module
|
||||
{
|
||||
Configuration::Block *config = Config->GetModule(this);
|
||||
|
||||
basedn = conf->Get<const Anope::string &>("basedn");
|
||||
search_filter = conf->Get<const Anope::string &>("search_filter");
|
||||
object_class = conf->Get<const Anope::string &>("object_class");
|
||||
username_attribute = conf->Get<const Anope::string &>("username_attribute");
|
||||
this->password_attribute = conf->Get<const Anope::string &>("password_attribute");
|
||||
email_attribute = conf->Get<const Anope::string &>("email_attribute");
|
||||
this->disable_register_reason = conf->Get<const Anope::string &>("disable_register_reason");
|
||||
this->disable_email_reason = conf->Get<const Anope::string &>("disable_email_reason");
|
||||
basedn = conf->Get<const Anope::string>("basedn");
|
||||
search_filter = conf->Get<const Anope::string>("search_filter");
|
||||
object_class = conf->Get<const Anope::string>("object_class");
|
||||
username_attribute = conf->Get<const Anope::string>("username_attribute");
|
||||
this->password_attribute = conf->Get<const Anope::string>("password_attribute");
|
||||
email_attribute = conf->Get<const Anope::string>("email_attribute");
|
||||
this->disable_register_reason = conf->Get<const Anope::string>("disable_register_reason");
|
||||
this->disable_email_reason = conf->Get<const Anope::string>("disable_email_reason");
|
||||
|
||||
if (!email_attribute.empty())
|
||||
/* Don't complain to users about how they need to update their email, we will do it for them */
|
||||
|
||||
@@ -97,11 +97,11 @@ class LDAPOper : public Module
|
||||
{
|
||||
Configuration::Block *config = Config->GetModule(this);
|
||||
|
||||
this->binddn = config->Get<const Anope::string &>("binddn");
|
||||
this->password = config->Get<const Anope::string &>("password");
|
||||
this->basedn = config->Get<const Anope::string &>("basedn");
|
||||
this->filter = config->Get<const Anope::string &>("filter");
|
||||
opertype_attribute = config->Get<const Anope::string &>("opertype_attribute");
|
||||
this->binddn = config->Get<const Anope::string>("binddn");
|
||||
this->password = config->Get<const Anope::string>("password");
|
||||
this->basedn = config->Get<const Anope::string>("basedn");
|
||||
this->filter = config->Get<const Anope::string>("filter");
|
||||
opertype_attribute = config->Get<const Anope::string>("opertype_attribute");
|
||||
|
||||
for (std::set<Oper *>::iterator it = my_opers.begin(), it_end = my_opers.end(); it != it_end; ++it)
|
||||
delete *it;
|
||||
|
||||
@@ -200,7 +200,7 @@ class ModuleSQL : public Module, public Pipe
|
||||
++it;
|
||||
|
||||
for (i = 0; i < Config->CountBlock("mysql"); ++i)
|
||||
if (Config->GetBlock("mysql", i)->Get<const Anope::string &>("name", "main") == cname)
|
||||
if (Config->GetBlock("mysql", i)->Get<const Anope::string>("name", "main") == cname)
|
||||
break;
|
||||
|
||||
if (i == num)
|
||||
@@ -215,14 +215,14 @@ class ModuleSQL : public Module, public Pipe
|
||||
for (i = 0; i < Config->CountBlock("mysql"); ++i)
|
||||
{
|
||||
Configuration::Block *block = Config->GetBlock("mysql", i);
|
||||
const Anope::string &connname = block->Get<const Anope::string &>("name", "mysql/main");
|
||||
const Anope::string &connname = block->Get<const Anope::string>("name", "mysql/main");
|
||||
|
||||
if (this->MySQLServices.find(connname) == this->MySQLServices.end())
|
||||
{
|
||||
const Anope::string &database = block->Get<const Anope::string &>("database", "anope");
|
||||
const Anope::string &server = block->Get<const Anope::string &>("server", "127.0.0.1");
|
||||
const Anope::string &user = block->Get<const Anope::string &>("username", "anope");
|
||||
const Anope::string &password = block->Get<const Anope::string &>("password");
|
||||
const Anope::string &database = block->Get<const Anope::string>("database", "anope");
|
||||
const Anope::string &server = block->Get<const Anope::string>("server", "127.0.0.1");
|
||||
const Anope::string &user = block->Get<const Anope::string>("username", "anope");
|
||||
const Anope::string &password = block->Get<const Anope::string>("password");
|
||||
int port = block->Get<int>("port", "3306");
|
||||
|
||||
try
|
||||
|
||||
@@ -257,7 +257,7 @@ class ModuleProxyScan : public Module
|
||||
{
|
||||
Configuration::Block *config = Config->GetModule(this);
|
||||
|
||||
Anope::string s_target_ip = config->Get<const Anope::string &>("target_ip");
|
||||
Anope::string s_target_ip = config->Get<const Anope::string>("target_ip");
|
||||
if (s_target_ip.empty())
|
||||
throw ConfigException(this->name + " target_ip may not be empty");
|
||||
|
||||
@@ -265,7 +265,7 @@ class ModuleProxyScan : public Module
|
||||
if (s_target_port <= 0)
|
||||
throw ConfigException(this->name + " target_port may not be empty and must be a positive number");
|
||||
|
||||
Anope::string s_listen_ip = config->Get<const Anope::string &>("listen_ip");
|
||||
Anope::string s_listen_ip = config->Get<const Anope::string>("listen_ip");
|
||||
if (s_listen_ip.empty())
|
||||
throw ConfigException(this->name + " listen_ip may not be empty");
|
||||
|
||||
@@ -277,12 +277,12 @@ class ModuleProxyScan : public Module
|
||||
target_port = s_target_port;
|
||||
this->listen_ip = s_listen_ip;
|
||||
this->listen_port = s_listen_port;
|
||||
this->con_notice = config->Get<const Anope::string &>("connect_notice");
|
||||
this->con_source = config->Get<const Anope::string &>("connect_source");
|
||||
this->con_notice = config->Get<const Anope::string>("connect_notice");
|
||||
this->con_source = config->Get<const Anope::string>("connect_source");
|
||||
add_to_akill = config->Get<bool>("add_to_akill", "true");
|
||||
this->connectionTimeout.SetSecs(config->Get<time_t>("timeout", "5s"));
|
||||
|
||||
ProxyCheckString = Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname") + " proxy check";
|
||||
ProxyCheckString = Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname") + " proxy check";
|
||||
delete this->listener;
|
||||
this->listener = NULL;
|
||||
try
|
||||
@@ -301,7 +301,7 @@ class ModuleProxyScan : public Module
|
||||
ProxyCheck p;
|
||||
Anope::string token;
|
||||
|
||||
commasepstream sep(block->Get<const Anope::string &>("type"));
|
||||
commasepstream sep(block->Get<const Anope::string>("type"));
|
||||
while (sep.GetToken(token))
|
||||
{
|
||||
if (!token.equals_ci("HTTP") && !token.equals_ci("SOCKS5"))
|
||||
@@ -311,7 +311,7 @@ class ModuleProxyScan : public Module
|
||||
if (p.types.empty())
|
||||
continue;
|
||||
|
||||
commasepstream sep2(block->Get<const Anope::string &>("port"));
|
||||
commasepstream sep2(block->Get<const Anope::string>("port"));
|
||||
while (sep2.GetToken(token))
|
||||
{
|
||||
try
|
||||
@@ -325,7 +325,7 @@ class ModuleProxyScan : public Module
|
||||
continue;
|
||||
|
||||
p.duration = block->Get<time_t>("time", "4h");
|
||||
p.reason = block->Get<const Anope::string &>("reason");
|
||||
p.reason = block->Get<const Anope::string>("reason");
|
||||
if (p.reason.empty())
|
||||
continue;
|
||||
|
||||
|
||||
@@ -85,9 +85,9 @@ class ModuleSQLAuthentication : public Module
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
Configuration::Block *config = conf->GetModule(this);
|
||||
this->engine = config->Get<const Anope::string &>("engine");
|
||||
this->query = config->Get<const Anope::string &>("query");
|
||||
this->disable_reason = config->Get<const Anope::string &>("disable_reason");
|
||||
this->engine = config->Get<const Anope::string>("engine");
|
||||
this->query = config->Get<const Anope::string>("query");
|
||||
this->disable_reason = config->Get<const Anope::string>("disable_reason");
|
||||
|
||||
this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine);
|
||||
}
|
||||
|
||||
@@ -105,8 +105,8 @@ class ModuleSQLOper : public Module
|
||||
{
|
||||
Configuration::Block *config = conf->GetModule(this);
|
||||
|
||||
this->engine = config->Get<const Anope::string &>("engine");
|
||||
this->query = config->Get<const Anope::string &>("query");
|
||||
this->engine = config->Get<const Anope::string>("engine");
|
||||
this->query = config->Get<const Anope::string>("query");
|
||||
|
||||
this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class ModuleSQLite : public Module
|
||||
++it;
|
||||
|
||||
for (i = 0, num = config->CountBlock("sqlite"); i < num; ++i)
|
||||
if (config->GetBlock("sqlite", i)->Get<const Anope::string &>("name", "sqlite/main") == cname)
|
||||
if (config->GetBlock("sqlite", i)->Get<const Anope::string>("name", "sqlite/main") == cname)
|
||||
break;
|
||||
|
||||
if (i == num)
|
||||
@@ -104,11 +104,11 @@ class ModuleSQLite : public Module
|
||||
for (int i = 0; i < config->CountBlock("sqlite"); ++i)
|
||||
{
|
||||
Configuration::Block *block = config->GetBlock("sqlite", i);
|
||||
Anope::string connname = block->Get<const Anope::string &>("name", "sqlite/main");
|
||||
Anope::string connname = block->Get<const Anope::string>("name", "sqlite/main");
|
||||
|
||||
if (this->SQLiteServices.find(connname) == this->SQLiteServices.end())
|
||||
{
|
||||
Anope::string database = Anope::DataDir + "/" + block->Get<const Anope::string &>("database", "anope");
|
||||
Anope::string database = Anope::DataDir + "/" + block->Get<const Anope::string>("database", "anope");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -140,8 +140,8 @@ class SSLModule : public Module
|
||||
{
|
||||
Configuration::Block *config = conf->GetModule(this);
|
||||
|
||||
this->certfile = config->Get<const Anope::string &>("cert", "data/anope.crt");
|
||||
this->keyfile = config->Get<const Anope::string &>("key", "data/anope.key");
|
||||
this->certfile = config->Get<const Anope::string>("cert", "data/anope.crt");
|
||||
this->keyfile = config->Get<const Anope::string>("key", "data/anope.key");
|
||||
|
||||
if (Anope::IsFile(this->certfile.c_str()))
|
||||
{
|
||||
|
||||
@@ -53,10 +53,10 @@ class ModuleWebCPanel : public Module
|
||||
me = this;
|
||||
|
||||
Configuration::Block *block = Config->GetModule(this);
|
||||
provider_name = block->Get<const Anope::string &>("server", "httpd/main");
|
||||
template_name = block->Get<const Anope::string &>("template", "default");
|
||||
provider_name = block->Get<const Anope::string>("server", "httpd/main");
|
||||
template_name = block->Get<const Anope::string>("template", "default");
|
||||
template_base = Anope::DataDir + "/modules/webcpanel/templates/" + template_name;
|
||||
page_title = block->Get<const Anope::string &>("title", "Anope IRC Services");
|
||||
page_title = block->Get<const Anope::string>("title", "Anope IRC Services");
|
||||
use_ssl = block->Get<bool>("ssl", "no"); // This is dumb, is there a better way to do this?
|
||||
|
||||
ServiceReference<HTTPProvider> provider("HTTPProvider", provider_name);
|
||||
|
||||
+4
-4
@@ -938,12 +938,12 @@ class ModuleDNS : public Module
|
||||
{
|
||||
Configuration::Block *block = conf->GetModule(this);
|
||||
|
||||
nameserver = block->Get<const Anope::string &>("nameserver", "127.0.0.1");
|
||||
nameserver = block->Get<const Anope::string>("nameserver", "127.0.0.1");
|
||||
timeout = block->Get<time_t>("timeout", "5");
|
||||
ip = block->Get<const Anope::string &>("ip", "0.0.0.0");
|
||||
ip = block->Get<const Anope::string>("ip", "0.0.0.0");
|
||||
port = block->Get<int>("port", "53");
|
||||
admin = block->Get<const Anope::string &>("admin", "admin@example.com");
|
||||
nameservers = block->Get<const Anope::string &>("nameservers", "ns1.example.com");
|
||||
admin = block->Get<const Anope::string>("admin", "admin@example.com");
|
||||
nameservers = block->Get<const Anope::string>("nameservers", "ns1.example.com");
|
||||
refresh = block->Get<int>("refresh", "3600");
|
||||
|
||||
if (Anope::IsFile(nameserver))
|
||||
|
||||
+4
-4
@@ -63,7 +63,7 @@ class DNSBLResolver : public Request
|
||||
reason = reason.replace_all_cs("%h", user->host);
|
||||
reason = reason.replace_all_cs("%i", user->ip);
|
||||
reason = reason.replace_all_cs("%r", record_reason);
|
||||
reason = reason.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
reason = reason.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
|
||||
Log(OperServ) << "DNSBL: " << user->GetMask() << " (" << user->ip << ") appears in " << this->blacklist.name;
|
||||
XLine *x = new XLine("*@" + user->ip, OperServ ? OperServ->nick : "m_dnsbl", Anope::CurTime + this->blacklist.bantime, reason, XLineManager::GenerateUID());
|
||||
@@ -107,15 +107,15 @@ class ModuleDNSBL : public Module
|
||||
{
|
||||
Configuration::Block *bl = conf->GetBlock("blacklist", i);
|
||||
|
||||
Anope::string bname = bl->Get<const Anope::string &>("name");
|
||||
Anope::string bname = bl->Get<const Anope::string>("name");
|
||||
if (bname.empty())
|
||||
continue;
|
||||
time_t bantime = bl->Get<time_t>("time", "4h");
|
||||
Anope::string reason = bl->Get<const Anope::string &>("reason");
|
||||
Anope::string reason = bl->Get<const Anope::string>("reason");
|
||||
std::map<int, Anope::string> replies;
|
||||
for (int j = 0; j < 256; ++j)
|
||||
{
|
||||
Anope::string k = bl->Get<const Anope::string &>(stringify(j));
|
||||
Anope::string k = bl->Get<const Anope::string>(stringify(j));
|
||||
if (!k.empty())
|
||||
replies[j] = k;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class HelpChannel : public Module
|
||||
|
||||
EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string ¶m) anope_override
|
||||
{
|
||||
if (mname == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string &>("helpchannel")))
|
||||
if (mname == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string>("helpchannel")))
|
||||
{
|
||||
User *u = User::Find(param);
|
||||
|
||||
|
||||
@@ -172,10 +172,10 @@ class ModuleRewrite : public Module
|
||||
|
||||
Rewrite rw;
|
||||
|
||||
rw.client = block->Get<const Anope::string &>("service");
|
||||
rw.source_message = block->Get<const Anope::string &>("rewrite_source");
|
||||
rw.target_message = block->Get<const Anope::string &>("rewrite_target");
|
||||
rw.desc = block->Get<const Anope::string &>("rewrite_description");
|
||||
rw.client = block->Get<const Anope::string>("service");
|
||||
rw.source_message = block->Get<const Anope::string>("rewrite_source");
|
||||
rw.target_message = block->Get<const Anope::string>("rewrite_target");
|
||||
rw.desc = block->Get<const Anope::string>("rewrite_description");
|
||||
|
||||
if (rw.client.empty() || rw.source_message.empty() || rw.target_message.empty())
|
||||
continue;
|
||||
|
||||
@@ -368,7 +368,7 @@ struct IRCDMessageCapab : Message::Capab
|
||||
else if (module.find("m_rline.so") == 0)
|
||||
{
|
||||
Servers::Capab.insert("RLINE");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string &>("regexengine");
|
||||
const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||
if (!regexengine.empty() && module.length() > 11 && regexengine != module.substr(11))
|
||||
Log() << "Warning: InspIRCd is using regex engine " << module.substr(11) << ", but we have " << regexengine << ". This may cause inconsistencies.";
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class BotServCore : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string &>("client");
|
||||
const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string>("client");
|
||||
|
||||
if (bsnick.empty())
|
||||
throw ConfigException(this->name + ": <client> must be defined");
|
||||
@@ -47,7 +47,7 @@ class BotServCore : public Module
|
||||
/* Do not allow removing bot modes on our service bots */
|
||||
if (chan->ci && chan->ci->bi == user)
|
||||
{
|
||||
const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string &>("botmodes");
|
||||
const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string>("botmodes");
|
||||
for (unsigned i = 0; i < botmodes.length(); ++i)
|
||||
chan->SetMode(chan->ci->bi, ModeManager::FindChannelModeByChar(botmodes[i]), chan->ci->bi->GetUID());
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class BotServCore : public Module
|
||||
{
|
||||
if (Me->IsSynced() && ci->c && ci->c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers"))
|
||||
{
|
||||
ChannelStatus status(Config->GetModule(this)->Get<const Anope::string &>("botmodes"));
|
||||
ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes"));
|
||||
bi->Join(ci->c, &status);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ class BotServCore : public Module
|
||||
|
||||
if (!realbuf.find(c->ci->bi->nick))
|
||||
params.erase(params.begin());
|
||||
else if (!realbuf.find_first_of(Config->GetModule(this)->Get<const Anope::string &>("fantasycharacter", "!")))
|
||||
else if (!realbuf.find_first_of(Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!")))
|
||||
params[0].erase(params[0].begin());
|
||||
else
|
||||
return;
|
||||
@@ -231,7 +231,7 @@ class BotServCore : public Module
|
||||
**/
|
||||
if (c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers") && !c->FindUser(c->ci->bi))
|
||||
{
|
||||
ChannelStatus status(Config->GetModule(this)->Get<const Anope::string &>("botmodes"));
|
||||
ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes"));
|
||||
c->ci->bi->Join(c, &status);
|
||||
}
|
||||
/* Only display the greet if the main uplink we're connected
|
||||
@@ -279,7 +279,7 @@ class BotServCore : public Module
|
||||
"channel, and provide a more convenient way to execute commands. Commands that\n"
|
||||
"require a channel as a parameter will automatically have that parameter\n"
|
||||
"given.\n"), source.service->nick.c_str());
|
||||
const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string &>("fantasycharacter", "!");
|
||||
const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!");
|
||||
if (!fantasycharacters.empty())
|
||||
source.Reply(_(" \n"
|
||||
"Fantasy commands may be prefixed with one of the following characters: %s\n"), fantasycharacters.c_str());
|
||||
@@ -310,7 +310,7 @@ class BotServCore : public Module
|
||||
source.Reply(_(" \n"
|
||||
"Bot will join a channel whenever there is at least\n"
|
||||
"\002%d\002 user(s) on it."), Config->GetModule(this)->Get<unsigned>("minusers"));
|
||||
const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string &>("fantasycharacter", "!");
|
||||
const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!");
|
||||
if (!fantasycharacters.empty())
|
||||
source.Reply(_("Additionally, if fantasy is enabled fantasy commands\n"
|
||||
"can be executed by prefixing the command name with\n"
|
||||
@@ -334,7 +334,7 @@ class BotServCore : public Module
|
||||
void OnCreateChan(ChannelInfo *ci) anope_override
|
||||
{
|
||||
/* Set default bot flags */
|
||||
spacesepstream sep(Config->GetModule(this)->Get<const Anope::string &>("defaults", "greet fantasy"));
|
||||
spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy"));
|
||||
for (Anope::string token; sep.GetToken(token);)
|
||||
this->ExtendMetadata("BS_" + token);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ class ChanServCore : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
const Anope::string &channick = conf->GetModule(this)->Get<const Anope::string &>("client");
|
||||
const Anope::string &channick = conf->GetModule(this)->Get<const Anope::string>("client");
|
||||
|
||||
if (channick.empty())
|
||||
throw ConfigException(this->name + ": <client> must be defined");
|
||||
@@ -160,7 +160,7 @@ class ChanServCore : public Module
|
||||
|
||||
ChanServ = bi;
|
||||
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string &>("defaults", "greet fantasy")).GetTokens(defaults);
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy")).GetTokens(defaults);
|
||||
if (defaults.empty())
|
||||
{
|
||||
defaults.push_back("KEEPTOPIC");
|
||||
@@ -297,7 +297,7 @@ class ChanServCore : public Module
|
||||
|
||||
EventReturn OnCheckModes(Channel *c) anope_override
|
||||
{
|
||||
const Anope::string &require = Config->GetModule(this)->Get<const Anope::string &>("require", "r");
|
||||
const Anope::string &require = Config->GetModule(this)->Get<const Anope::string>("require", "r");
|
||||
if (!require.empty())
|
||||
{
|
||||
if (c->ci)
|
||||
@@ -319,7 +319,7 @@ class ChanServCore : public Module
|
||||
|
||||
{
|
||||
Anope::string modes;
|
||||
spacesepstream sep(Config->GetModule(this)->Get<const Anope::string &>("mlock", "+nrt"));
|
||||
spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("mlock", "+nrt"));
|
||||
if (sep.GetToken(modes))
|
||||
{
|
||||
bool add = true;
|
||||
@@ -343,8 +343,8 @@ class ChanServCore : public Module
|
||||
|
||||
EventReturn OnCanSet(User *u, const ChannelMode *cm) anope_override
|
||||
{
|
||||
if (Config->GetModule(this)->Get<const Anope::string &>("nomlock").find(cm->mchar) != Anope::string::npos
|
||||
|| Config->GetModule(this)->Get<const Anope::string &>("require", "r").find(cm->mchar) || Anope::string::npos)
|
||||
if (Config->GetModule(this)->Get<const Anope::string>("nomlock").find(cm->mchar) != Anope::string::npos
|
||||
|| Config->GetModule(this)->Get<const Anope::string>("require", "r").find(cm->mchar) || Anope::string::npos)
|
||||
return EVENT_STOP;
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class GlobalCore : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
const Anope::string &glnick = conf->GetModule(this)->Get<const Anope::string &>("client");
|
||||
const Anope::string &glnick = conf->GetModule(this)->Get<const Anope::string>("client");
|
||||
|
||||
if (glnick.empty())
|
||||
throw ConfigException(this->name + ": <client> must be defined");
|
||||
@@ -81,21 +81,21 @@ class GlobalCore : public Module
|
||||
|
||||
void OnRestart() anope_override
|
||||
{
|
||||
const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string &>("globaloncycledown");
|
||||
const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown");
|
||||
if (!gl.empty())
|
||||
this->global.SendGlobal(Global, "", gl);
|
||||
}
|
||||
|
||||
void OnShutdown() anope_override
|
||||
{
|
||||
const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string &>("globaloncycledown");
|
||||
const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown");
|
||||
if (!gl.empty())
|
||||
this->global.SendGlobal(Global, "", gl);
|
||||
}
|
||||
|
||||
void OnNewServer(Server *s) anope_override
|
||||
{
|
||||
const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string &>("globaloncycleup");
|
||||
const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycleup");
|
||||
if (!gl.empty() && !Me->IsSynced())
|
||||
s->Notice(Global, gl);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class HostServCore : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
const Anope::string &hsnick = conf->GetModule(this)->Get<const Anope::string &>("client");
|
||||
const Anope::string &hsnick = conf->GetModule(this)->Get<const Anope::string>("client");
|
||||
|
||||
if (hsnick.empty())
|
||||
throw ConfigException(this->name + ": <client> must be defined");
|
||||
|
||||
@@ -22,13 +22,13 @@ static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
|
||||
subject = subject.replace_all_cs("%s", m->sender);
|
||||
subject = subject.replace_all_cs("%d", stringify(mi->GetIndex(m) + 1));
|
||||
subject = subject.replace_all_cs("%t", m->text);
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
|
||||
message = message.replace_all_cs("%n", nc->display);
|
||||
message = message.replace_all_cs("%s", m->sender);
|
||||
message = message.replace_all_cs("%d", stringify(mi->GetIndex(m) + 1));
|
||||
message = message.replace_all_cs("%t", m->text);
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string &>("networkname"));
|
||||
message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname"));
|
||||
|
||||
return Mail::Send(nc, subject, message);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ class MemoServCore : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
const Anope::string &msnick = conf->GetModule(this)->Get<const Anope::string &>("client");
|
||||
const Anope::string &msnick = conf->GetModule(this)->Get<const Anope::string>("client");
|
||||
|
||||
if (msnick.empty())
|
||||
throw ConfigException(this->name + ": <client> must be defined");
|
||||
|
||||
@@ -209,7 +209,7 @@ class NickServCore : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
const Anope::string &nsnick = conf->GetModule(this)->Get<const Anope::string &>("client");
|
||||
const Anope::string &nsnick = conf->GetModule(this)->Get<const Anope::string>("client");
|
||||
|
||||
if (nsnick.empty())
|
||||
throw ConfigException(this->name + ": <client> must be defined");
|
||||
@@ -220,7 +220,7 @@ class NickServCore : public Module
|
||||
|
||||
NickServ = bi;
|
||||
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string &>("defaults", "secure memo_signon memo_receive")).GetTokens(defaults);
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "secure memo_signon memo_receive")).GetTokens(defaults);
|
||||
if (defaults.empty())
|
||||
{
|
||||
defaults.push_back("SECURE");
|
||||
@@ -287,7 +287,7 @@ class NickServCore : public Module
|
||||
c->SetCorrectModes(u, true, true);
|
||||
}
|
||||
|
||||
const Anope::string &modesonid = block->Get<const Anope::string &>("modesonid");
|
||||
const Anope::string &modesonid = block->Get<const Anope::string>("modesonid");
|
||||
if (!modesonid.empty())
|
||||
u->SetModes(NickServ, "%s", modesonid.c_str());
|
||||
|
||||
@@ -335,7 +335,7 @@ class NickServCore : public Module
|
||||
return;
|
||||
|
||||
const NickAlias *na = NickAlias::Find(u->nick);
|
||||
const Anope::string &unregistered_notice = Config->GetModule(this)->Get<const Anope::string &>("unregistered_notice");
|
||||
const Anope::string &unregistered_notice = Config->GetModule(this)->Get<const Anope::string>("unregistered_notice");
|
||||
if (!Config->GetBlock("options")->Get<bool>("nonicknameownership") && !unregistered_notice.empty() && !na)
|
||||
u->SendMessage(NickServ, unregistered_notice);
|
||||
else if (na)
|
||||
|
||||
@@ -185,7 +185,7 @@ class OperServCore : public Module
|
||||
|
||||
void OnReload(Configuration::Conf *conf) anope_override
|
||||
{
|
||||
const Anope::string &osnick = conf->GetModule(this)->Get<const Anope::string &>("client");
|
||||
const Anope::string &osnick = conf->GetModule(this)->Get<const Anope::string>("client");
|
||||
|
||||
if (osnick.empty())
|
||||
throw ConfigException(this->name + ": <client> must be defined");
|
||||
|
||||
Reference in New Issue
Block a user