mirror of
https://github.com/anope/anope.git
synced 2026-06-27 16:06:39 +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:
+2
-2
@@ -49,7 +49,7 @@ namespace Configuration
|
||||
*/
|
||||
template<typename T> T Get(const Anope::string &tag, const Anope::string &def) const
|
||||
{
|
||||
const Anope::string &value = this->Get<const Anope::string &>(tag, def);
|
||||
const Anope::string &value = this->Get<const Anope::string>(tag, def);
|
||||
try
|
||||
{
|
||||
return convertTo<T>(value);
|
||||
@@ -64,7 +64,7 @@ namespace Configuration
|
||||
const item_map* GetItems() const;
|
||||
};
|
||||
|
||||
template<> CoreExport const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const;
|
||||
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const;
|
||||
template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
template<> CoreExport const char* Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
|
||||
@@ -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");
|
||||
|
||||
+72
-78
@@ -77,37 +77,31 @@ const Block::item_map* Block::GetItems() const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template<> const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const
|
||||
template<> const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const
|
||||
{
|
||||
static Anope::string ret;
|
||||
|
||||
if (!this)
|
||||
{
|
||||
ret = def;
|
||||
return ret;
|
||||
}
|
||||
return def;
|
||||
|
||||
Anope::map<Anope::string>::const_iterator it = items.find(tag);
|
||||
if (it != items.end())
|
||||
return it->second;
|
||||
|
||||
ret = def;
|
||||
return ret;
|
||||
return def;
|
||||
}
|
||||
|
||||
template<> time_t Block::Get(const Anope::string &tag, const Anope::string &def) const
|
||||
{
|
||||
return Anope::DoTime(Get<const Anope::string &>(tag, def));
|
||||
return Anope::DoTime(Get<const Anope::string>(tag, def));
|
||||
}
|
||||
|
||||
template<> const char* Block::Get(const Anope::string &tag, const Anope::string &def) const
|
||||
{
|
||||
return this->Get<const Anope::string &>(tag, def).c_str();
|
||||
return this->Get<const Anope::string>(tag, def).c_str();
|
||||
}
|
||||
|
||||
template<> bool Block::Get(const Anope::string &tag, const Anope::string &def) const
|
||||
{
|
||||
const Anope::string &str = Get<const Anope::string &>(tag, def);
|
||||
const Anope::string &str = Get<const Anope::string>(tag, def);
|
||||
return str.equals_ci("yes") || str.equals_ci("on") || str.equals_ci("true");
|
||||
}
|
||||
|
||||
@@ -134,8 +128,8 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *include = this->GetBlock("include", i);
|
||||
|
||||
const Anope::string &type = include->Get<const Anope::string &>("type"),
|
||||
&file = include->Get<const Anope::string &>("name");
|
||||
const Anope::string &type = include->Get<const Anope::string>("type"),
|
||||
&file = include->Get<const Anope::string>("name");
|
||||
|
||||
File f(file, type == "executable");
|
||||
this->LoadConf(f);
|
||||
@@ -165,7 +159,7 @@ Conf::Conf() : Block("")
|
||||
};
|
||||
|
||||
for (unsigned i = 0; i < sizeof(noreload) / sizeof(noreload[0]); ++i)
|
||||
if (this->GetBlock(noreload[i].block)->Get<const Anope::string &>(noreload[i].name, noreload[i].def) != Config->GetBlock(noreload[i].block)->Get<const Anope::string &>(noreload[i].name, noreload[i].def))
|
||||
if (this->GetBlock(noreload[i].block)->Get<const Anope::string>(noreload[i].name, noreload[i].def) != Config->GetBlock(noreload[i].block)->Get<const Anope::string>(noreload[i].name, noreload[i].def))
|
||||
throw ConfigException("<" + noreload[i].block + ":" + noreload[i].name + "> can not be modified once set");
|
||||
}
|
||||
|
||||
@@ -178,17 +172,17 @@ Conf::Conf() : Block("")
|
||||
ValidateNotZero("options", "warningtimeout", options->Get<time_t>("warningtimeout"));
|
||||
ValidateNotZero("options", "timeoutcheck", options->Get<time_t>("timeoutcheck"));
|
||||
|
||||
ValidateNotEmpty("options", "enforceruser", options->Get<const Anope::string &>("enforceruser"));
|
||||
ValidateNotEmpty("options", "enforcerhost", options->Get<const Anope::string &>("enforcerhost"));
|
||||
ValidateNotEmpty("options", "guestnickprefix", options->Get<const Anope::string &>("guestnickprefix"));
|
||||
ValidateNotEmpty("options", "enforceruser", options->Get<const Anope::string>("enforceruser"));
|
||||
ValidateNotEmpty("options", "enforcerhost", options->Get<const Anope::string>("enforcerhost"));
|
||||
ValidateNotEmpty("options", "guestnickprefix", options->Get<const Anope::string>("guestnickprefix"));
|
||||
|
||||
spacesepstream(options->Get<const Anope::string &>("ulineservers")).GetTokens(this->Ulines);
|
||||
spacesepstream(options->Get<const Anope::string>("ulineservers")).GetTokens(this->Ulines);
|
||||
|
||||
if (mail->Get<bool>("usemail"))
|
||||
{
|
||||
Anope::string check[] = { "sendmailpath", "sendfrom", "registration_subject", "registration_message", "emailchange_subject", "emailchange_message", "memo_subject", "memo_message" };
|
||||
for (unsigned i = 0; i < sizeof(check) / sizeof(Anope::string); ++i)
|
||||
ValidateNotEmpty("mail", check[i], mail->Get<const Anope::string &>(check[i]));
|
||||
ValidateNotEmpty("mail", check[i], mail->Get<const Anope::string>(check[i]));
|
||||
}
|
||||
|
||||
this->ReadTimeout = options->Get<unsigned>("readtimeout");
|
||||
@@ -196,20 +190,20 @@ Conf::Conf() : Block("")
|
||||
this->StrictPrivmsg = options->Get<bool>("usestrictprivmsg") ? "/msg " : "/";
|
||||
{
|
||||
std::vector<Anope::string> defaults;
|
||||
spacesepstream(this->GetModule("nickserv")->Get<const Anope::string &>("defaults")).GetTokens(defaults);
|
||||
spacesepstream(this->GetModule("nickserv")->Get<const Anope::string>("defaults")).GetTokens(defaults);
|
||||
this->DefPrivmsg = std::find(defaults.begin(), defaults.end(), "msg") != defaults.end();
|
||||
}
|
||||
this->DefLanguage = options->Get<const Anope::string &>("defaultlanguage");
|
||||
this->DefLanguage = options->Get<const Anope::string>("defaultlanguage");
|
||||
this->TimeoutCheck = options->Get<time_t>("timeoutcheck");
|
||||
|
||||
for (int i = 0; i < this->CountBlock("uplink"); ++i)
|
||||
{
|
||||
Block *uplink = this->GetBlock("uplink", i);
|
||||
|
||||
const Anope::string &host = uplink->Get<const Anope::string &>("host");
|
||||
const Anope::string &host = uplink->Get<const Anope::string>("host");
|
||||
bool ipv6 = uplink->Get<bool>("ipv6");
|
||||
int port = uplink->Get<int>("port");
|
||||
const Anope::string &password = uplink->Get<const Anope::string &>("password");
|
||||
const Anope::string &password = uplink->Get<const Anope::string>("password");
|
||||
|
||||
ValidateNotEmpty("uplink", "host", host);
|
||||
ValidateNotEmpty("uplink", "password", password);
|
||||
@@ -221,7 +215,7 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *module = this->GetBlock("module", i);
|
||||
|
||||
const Anope::string &modname = module->Get<const Anope::string &>("name");
|
||||
const Anope::string &modname = module->Get<const Anope::string>("name");
|
||||
|
||||
ValidateNotEmpty("module", "name", modname);
|
||||
|
||||
@@ -232,11 +226,11 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *opertype = this->GetBlock("opertype", i);
|
||||
|
||||
const Anope::string &oname = opertype->Get<const Anope::string &>("name"),
|
||||
&modes = opertype->Get<const Anope::string &>("modes"),
|
||||
&inherits = opertype->Get<const Anope::string &>("inherits"),
|
||||
&commands = opertype->Get<const Anope::string &>("commands"),
|
||||
&privs = opertype->Get<const Anope::string &>("privs");
|
||||
const Anope::string &oname = opertype->Get<const Anope::string>("name"),
|
||||
&modes = opertype->Get<const Anope::string>("modes"),
|
||||
&inherits = opertype->Get<const Anope::string>("inherits"),
|
||||
&commands = opertype->Get<const Anope::string>("commands"),
|
||||
&privs = opertype->Get<const Anope::string>("privs");
|
||||
|
||||
ValidateNotEmpty("opertype", "name", oname);
|
||||
|
||||
@@ -277,12 +271,12 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *oper = this->GetBlock("oper", i);
|
||||
|
||||
const Anope::string &nname = oper->Get<const Anope::string &>("name"),
|
||||
&type = oper->Get<const Anope::string &>("type"),
|
||||
&password = oper->Get<const Anope::string &>("password"),
|
||||
&certfp = oper->Get<const Anope::string &>("certfp"),
|
||||
&host = oper->Get<const Anope::string &>("host"),
|
||||
&vhost = oper->Get<const Anope::string &>("vhost");
|
||||
const Anope::string &nname = oper->Get<const Anope::string>("name"),
|
||||
&type = oper->Get<const Anope::string>("type"),
|
||||
&password = oper->Get<const Anope::string>("password"),
|
||||
&certfp = oper->Get<const Anope::string>("certfp"),
|
||||
&host = oper->Get<const Anope::string>("host"),
|
||||
&vhost = oper->Get<const Anope::string>("vhost");
|
||||
bool require_oper = oper->Get<bool>("require_oper");
|
||||
|
||||
ValidateNotEmpty("oper", "name", nname);
|
||||
@@ -312,12 +306,12 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *service = this->GetBlock("service", i);
|
||||
|
||||
const Anope::string &nick = service->Get<const Anope::string &>("nick"),
|
||||
&user = service->Get<const Anope::string &>("user"),
|
||||
&host = service->Get<const Anope::string &>("host"),
|
||||
&gecos = service->Get<const Anope::string &>("gecos"),
|
||||
&modes = service->Get<const Anope::string &>("modes"),
|
||||
&channels = service->Get<const Anope::string &>("channels");
|
||||
const Anope::string &nick = service->Get<const Anope::string>("nick"),
|
||||
&user = service->Get<const Anope::string>("user"),
|
||||
&host = service->Get<const Anope::string>("host"),
|
||||
&gecos = service->Get<const Anope::string>("gecos"),
|
||||
&modes = service->Get<const Anope::string>("modes"),
|
||||
&channels = service->Get<const Anope::string>("channels");
|
||||
|
||||
ValidateNotEmpty("service", "nick", nick);
|
||||
ValidateNotEmpty("service", "user", user);
|
||||
@@ -398,15 +392,15 @@ Conf::Conf() : Block("")
|
||||
|
||||
LogInfo l(logage, rawio, debug);
|
||||
|
||||
spacesepstream(log->Get<const Anope::string &>("target")).GetTokens(l.targets);
|
||||
spacesepstream(log->Get<const Anope::string &>("source")).GetTokens(l.sources);
|
||||
spacesepstream(log->Get<const Anope::string &>("admin")).GetTokens(l.admin);
|
||||
spacesepstream(log->Get<const Anope::string &>("override")).GetTokens(l.override);
|
||||
spacesepstream(log->Get<const Anope::string &>("commands")).GetTokens(l.commands);
|
||||
spacesepstream(log->Get<const Anope::string &>("servers")).GetTokens(l.servers);
|
||||
spacesepstream(log->Get<const Anope::string &>("channels")).GetTokens(l.channels);
|
||||
spacesepstream(log->Get<const Anope::string &>("users")).GetTokens(l.users);
|
||||
spacesepstream(log->Get<const Anope::string &>("normal")).GetTokens(l.normal);
|
||||
spacesepstream(log->Get<const Anope::string>("target")).GetTokens(l.targets);
|
||||
spacesepstream(log->Get<const Anope::string>("source")).GetTokens(l.sources);
|
||||
spacesepstream(log->Get<const Anope::string>("admin")).GetTokens(l.admin);
|
||||
spacesepstream(log->Get<const Anope::string>("override")).GetTokens(l.override);
|
||||
spacesepstream(log->Get<const Anope::string>("commands")).GetTokens(l.commands);
|
||||
spacesepstream(log->Get<const Anope::string>("servers")).GetTokens(l.servers);
|
||||
spacesepstream(log->Get<const Anope::string>("channels")).GetTokens(l.channels);
|
||||
spacesepstream(log->Get<const Anope::string>("users")).GetTokens(l.users);
|
||||
spacesepstream(log->Get<const Anope::string>("normal")).GetTokens(l.normal);
|
||||
|
||||
this->LogInfos.push_back(l);
|
||||
}
|
||||
@@ -417,11 +411,11 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *command = this->GetBlock("command", i);
|
||||
|
||||
const Anope::string &service = command->Get<const Anope::string &>("service"),
|
||||
&nname = command->Get<const Anope::string &>("name"),
|
||||
&cmd = command->Get<const Anope::string &>("command"),
|
||||
&permission = command->Get<const Anope::string &>("permission"),
|
||||
&group = command->Get<const Anope::string &>("group");
|
||||
const Anope::string &service = command->Get<const Anope::string>("service"),
|
||||
&nname = command->Get<const Anope::string>("name"),
|
||||
&cmd = command->Get<const Anope::string>("command"),
|
||||
&permission = command->Get<const Anope::string>("permission"),
|
||||
&group = command->Get<const Anope::string>("group");
|
||||
bool hide = command->Get<bool>("hide");
|
||||
|
||||
ValidateNotEmpty("command", "service", service);
|
||||
@@ -442,8 +436,8 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *privilege = this->GetBlock("privilege", i);
|
||||
|
||||
const Anope::string &nname = privilege->Get<const Anope::string &>("name"),
|
||||
&desc = privilege->Get<const Anope::string &>("desc");
|
||||
const Anope::string &nname = privilege->Get<const Anope::string>("name"),
|
||||
&desc = privilege->Get<const Anope::string>("desc");
|
||||
int rank = privilege->Get<int>("rank");
|
||||
|
||||
PrivilegeManager::AddPrivilege(Privilege(nname, desc, rank));
|
||||
@@ -453,10 +447,10 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *fantasy = this->GetBlock("fantasy", i);
|
||||
|
||||
const Anope::string &nname = fantasy->Get<const Anope::string &>("name"),
|
||||
&service = fantasy->Get<const Anope::string &>("command"),
|
||||
&permission = fantasy->Get<const Anope::string &>("permission"),
|
||||
&group = fantasy->Get<const Anope::string &>("group");
|
||||
const Anope::string &nname = fantasy->Get<const Anope::string>("name"),
|
||||
&service = fantasy->Get<const Anope::string>("command"),
|
||||
&permission = fantasy->Get<const Anope::string>("permission"),
|
||||
&group = fantasy->Get<const Anope::string>("group");
|
||||
bool hide = fantasy->Get<bool>("hide"),
|
||||
prepend_channel = fantasy->Get<bool>("prepend_channel");
|
||||
|
||||
@@ -475,8 +469,8 @@ Conf::Conf() : Block("")
|
||||
{
|
||||
Block *command_group = this->GetBlock("command_group", i);
|
||||
|
||||
const Anope::string &nname = command_group->Get<const Anope::string &>("name"),
|
||||
&description = command_group->Get<const Anope::string &>("description");
|
||||
const Anope::string &nname = command_group->Get<const Anope::string>("name"),
|
||||
&description = command_group->Get<const Anope::string>("description");
|
||||
|
||||
CommandGroup gr;
|
||||
gr.name = nname;
|
||||
@@ -505,9 +499,9 @@ Conf::Conf() : Block("")
|
||||
Log() << "Tied oper " << na->nc->display << " to type " << o->ot->GetName();
|
||||
}
|
||||
|
||||
if (options->Get<const Anope::string &>("casemap", "ascii") == "ascii")
|
||||
if (options->Get<const Anope::string>("casemap", "ascii") == "ascii")
|
||||
Anope::casemap = std::locale(std::locale(), new Anope::ascii_ctype<char>());
|
||||
else if (options->Get<const Anope::string &>("casemap") == "rfc1459")
|
||||
else if (options->Get<const Anope::string>("casemap") == "rfc1459")
|
||||
Anope::casemap = std::locale(std::locale(), new Anope::rfc1459_ctype<char>());
|
||||
else
|
||||
{
|
||||
@@ -517,7 +511,7 @@ Conf::Conf() : Block("")
|
||||
}
|
||||
catch (const std::runtime_error &)
|
||||
{
|
||||
Log() << "Unknown casemap " << options->Get<const Anope::string &>("casemap") << " - casemap not changed";
|
||||
Log() << "Unknown casemap " << options->Get<const Anope::string>("casemap") << " - casemap not changed";
|
||||
}
|
||||
}
|
||||
Anope::CaseMapRebuild();
|
||||
@@ -527,27 +521,27 @@ Conf::Conf() : Block("")
|
||||
Log() << "Configuration option options:seed should be set. It's for YOUR safety! Remember that!";
|
||||
|
||||
#ifndef _WIN32
|
||||
if (!options->Get<const Anope::string &>("user").empty())
|
||||
if (!options->Get<const Anope::string>("user").empty())
|
||||
{
|
||||
errno = 0;
|
||||
struct passwd *u = getpwnam(options->Get<const char *>("user"));
|
||||
if (u == NULL)
|
||||
Log() << "Unable to setuid to " << options->Get<const Anope::string &>("user") << ": " << Anope::LastError();
|
||||
Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
|
||||
else if (setuid(u->pw_uid) == -1)
|
||||
Log() << "Unable to setuid to " << options->Get<const Anope::string &>("user") << ": " << Anope::LastError();
|
||||
Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError();
|
||||
else
|
||||
Log() << "Successfully set user to " << options->Get<const Anope::string &>("user");
|
||||
Log() << "Successfully set user to " << options->Get<const Anope::string>("user");
|
||||
}
|
||||
if (!options->Get<const Anope::string &>("group").empty())
|
||||
if (!options->Get<const Anope::string>("group").empty())
|
||||
{
|
||||
errno = 0;
|
||||
struct group *g = getgrnam(options->Get<const char *>("group"));
|
||||
if (g == NULL)
|
||||
Log() << "Unable to setgid to " << options->Get<const Anope::string &>("group") << ": " << Anope::LastError();
|
||||
Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
|
||||
else if (setuid(g->gr_gid) == -1)
|
||||
Log() << "Unable to setgid to " << options->Get<const Anope::string &>("group") << ": " << Anope::LastError();
|
||||
Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError();
|
||||
else
|
||||
Log() << "Successfully set group to " << options->Get<const Anope::string &>("group");
|
||||
Log() << "Successfully set group to " << options->Get<const Anope::string>("group");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -584,7 +578,7 @@ Block *Conf::GetModule(const Anope::string &mname)
|
||||
{
|
||||
Block *b = &iters.first->second;
|
||||
|
||||
if (b->Get<const Anope::string &>("name") == mname)
|
||||
if (b->Get<const Anope::string>("name") == mname)
|
||||
{
|
||||
block = b;
|
||||
break;
|
||||
@@ -835,10 +829,10 @@ void Conf::LoadConf(File &file)
|
||||
{
|
||||
Block *define = this->GetBlock("define", i);
|
||||
|
||||
const Anope::string &dname = define->Get<const Anope::string &>("name");
|
||||
const Anope::string &dname = define->Get<const Anope::string>("name");
|
||||
|
||||
if (dname == wordbuffer)
|
||||
wordbuffer = define->Get<const Anope::string &>("value");
|
||||
wordbuffer = define->Get<const Anope::string>("value");
|
||||
}
|
||||
|
||||
if (b)
|
||||
|
||||
+3
-3
@@ -216,7 +216,7 @@ static void write_pidfile()
|
||||
atexit(remove_pidfile);
|
||||
}
|
||||
else
|
||||
throw CoreException("Can not write to PID file " + Config->GetBlock("serverinfo")->Get<const Anope::string &>("pid"));
|
||||
throw CoreException("Can not write to PID file " + Config->GetBlock("serverinfo")->Get<const Anope::string>("pid"));
|
||||
}
|
||||
|
||||
void Anope::Init(int ac, char **av)
|
||||
@@ -430,7 +430,7 @@ void Anope::Init(int ac, char **av)
|
||||
|
||||
/* Create me */
|
||||
Configuration::Block *block = Config->GetBlock("serverinfo");
|
||||
Me = new Server(NULL, block->Get<const Anope::string &>("name"), 0, block->Get<const Anope::string &>("description"), block->Get<const Anope::string &>("id"));
|
||||
Me = new Server(NULL, block->Get<const Anope::string>("name"), 0, block->Get<const Anope::string>("description"), block->Get<const Anope::string>("id"));
|
||||
for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it)
|
||||
{
|
||||
it->second->server = Me;
|
||||
@@ -452,7 +452,7 @@ void Anope::Init(int ac, char **av)
|
||||
/* load modules */
|
||||
Log() << "Loading modules...";
|
||||
for (int i = 0; i < Config->CountBlock("module"); ++i)
|
||||
ModuleManager::LoadModule(Config->GetBlock("module", i)->Get<const Anope::string &>("name"), NULL);
|
||||
ModuleManager::LoadModule(Config->GetBlock("module", i)->Get<const Anope::string>("name"), NULL);
|
||||
|
||||
Module *protocol = ModuleManager::FindFirstOf(PROTOCOL);
|
||||
if (protocol == NULL)
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ void Language::InitLanguages()
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
spacesepstream sep(Config->GetBlock("options")->Get<const Anope::string &>("languages"));
|
||||
spacesepstream sep(Config->GetBlock("options")->Get<const Anope::string>("languages"));
|
||||
Anope::string language;
|
||||
while (sep.GetToken(language))
|
||||
{
|
||||
|
||||
+7
-7
@@ -14,7 +14,7 @@
|
||||
#include "mail.h"
|
||||
#include "config.h"
|
||||
|
||||
Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string &>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false)
|
||||
Mail::Message::Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &a, const Anope::string &s, const Anope::string &m) : Thread(), sendmail_path(Config->GetBlock("mail")->Get<const Anope::string>("sendmailpath")), send_from(sf), mail_to(mailto), addr(a), subject(s), message(m), dont_quote_addresses(Config->GetBlock("mail")->Get<bool>("dontquoteaddresses")), success(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -60,19 +60,19 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri
|
||||
|
||||
if (!u)
|
||||
{
|
||||
if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty())
|
||||
if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty())
|
||||
return false;
|
||||
else if (nc->email.empty())
|
||||
return false;
|
||||
|
||||
nc->lastmail = Anope::CurTime;
|
||||
Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message);
|
||||
Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message);
|
||||
t->Start();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty())
|
||||
if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty())
|
||||
u->SendMessage(service, _("Services have been configured to not send mail."));
|
||||
else if (Anope::CurTime - u->lastmail < b->Get<time_t>("delay"))
|
||||
u->SendMessage(service, _("Please wait \002%d\002 seconds and retry."), b->Get<time_t>("delay") - (Anope::CurTime - u->lastmail));
|
||||
@@ -81,7 +81,7 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri
|
||||
else
|
||||
{
|
||||
u->lastmail = nc->lastmail = Anope::CurTime;
|
||||
Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message);
|
||||
Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message);
|
||||
t->Start();
|
||||
return true;
|
||||
}
|
||||
@@ -93,11 +93,11 @@ bool Mail::Send(User *u, NickCore *nc, const BotInfo *service, const Anope::stri
|
||||
bool Mail::Send(NickCore *nc, const Anope::string &subject, const Anope::string &message)
|
||||
{
|
||||
Configuration::Block *b = Config->GetBlock("mail");
|
||||
if (!b->Get<bool>("usemail") || b->Get<const Anope::string &>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty())
|
||||
if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty())
|
||||
return false;
|
||||
|
||||
nc->lastmail = Anope::CurTime;
|
||||
Thread *t = new Mail::Message(b->Get<const Anope::string &>("sendfrom"), nc->display, nc->email, subject, message);
|
||||
Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->display, nc->email, subject, message);
|
||||
t->Start();
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -382,7 +382,7 @@ bool Anope::Match(const Anope::string &str, const Anope::string &mask, bool case
|
||||
|
||||
if (r == NULL || r->GetExpression() != stripped_mask)
|
||||
{
|
||||
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string &>("regexengine"));
|
||||
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string>("regexengine"));
|
||||
if (provider)
|
||||
{
|
||||
try
|
||||
|
||||
+2
-2
@@ -139,8 +139,8 @@ class CoreExport NickServRelease : public User, public Timer
|
||||
* @param na The nick
|
||||
* @param delay The delay before the nick is released
|
||||
*/
|
||||
NickServRelease(NickAlias *na, time_t delay) : User(na->nick, Config->GetBlock("options")->Get<const Anope::string &>("enforceruser"),
|
||||
Config->GetBlock("options")->Get<const Anope::string &>("enforcerhost"), "", "", Me, "Services Enforcer", Anope::CurTime, "", Servers::TS6_UID_Retrieve()), Timer(delay), nick(na->nick)
|
||||
NickServRelease(NickAlias *na, time_t delay) : User(na->nick, Config->GetBlock("options")->Get<const Anope::string>("enforceruser"),
|
||||
Config->GetBlock("options")->Get<const Anope::string>("enforcerhost"), "", "", Me, "Services Enforcer", Anope::CurTime, "", Servers::TS6_UID_Retrieve()), Timer(delay), nick(na->nick)
|
||||
{
|
||||
/* Erase the current release timer and use the new one */
|
||||
std::map<Anope::string, NickServRelease *>::iterator nit = NickServReleases.find(this->nick);
|
||||
|
||||
+2
-2
@@ -349,8 +349,8 @@ bool IRCDProto::IsHostValid(const Anope::string &host)
|
||||
if (host.empty() || host.length() > Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"))
|
||||
return false;
|
||||
|
||||
const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo")->Get<const Anope::string &>("disallow_start_or_end"),
|
||||
vhostchars = Config->GetBlock("networkinfo")->Get<const Anope::string &>("vhost_chars");
|
||||
const Anope::string &vhostdisablebe = Config->GetBlock("networkinfo")->Get<const Anope::string>("disallow_start_or_end"),
|
||||
vhostchars = Config->GetBlock("networkinfo")->Get<const Anope::string>("vhost_chars");
|
||||
|
||||
if (vhostdisablebe.find_first_of(host[0]) != Anope::string::npos)
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -377,7 +377,7 @@ const Anope::string Servers::TS6_SID_Retrieve()
|
||||
if (!IRCD || !IRCD->RequiresID)
|
||||
return "";
|
||||
|
||||
static Anope::string current_sid = Config->GetBlock("options")->Get<const Anope::string &>("id");
|
||||
static Anope::string current_sid = Config->GetBlock("options")->Get<const Anope::string>("id");
|
||||
if (current_sid.empty())
|
||||
current_sid = "00A";
|
||||
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ void Uplink::Connect()
|
||||
Configuration::Uplink &u = Config->Uplinks[Anope::CurrentUplink];
|
||||
|
||||
new UplinkSocket();
|
||||
if (!Config->GetBlock("serverinfo")->Get<const Anope::string &>("localhost").empty())
|
||||
UplinkSock->Bind(Config->GetBlock("serverinfo")->Get<const Anope::string &>("localhost"));
|
||||
if (!Config->GetBlock("serverinfo")->Get<const Anope::string>("localhost").empty())
|
||||
UplinkSock->Bind(Config->GetBlock("serverinfo")->Get<const Anope::string>("localhost"));
|
||||
FOREACH_MOD(I_OnPreServerConnect, OnPreServerConnect());
|
||||
Anope::string ip = Anope::Resolve(u.host, u.ipv6 ? AF_INET6 : AF_INET);
|
||||
Log(LOG_TERMINAL) << "Attempting to connect to uplink #" << (Anope::CurrentUplink + 1) << " " << u.host << " (" << ip << "), port " << u.port;
|
||||
|
||||
+1
-1
@@ -322,7 +322,7 @@ void User::Collide(NickAlias *na)
|
||||
|
||||
if (IRCD->CanSVSNick)
|
||||
{
|
||||
const Anope::string &guestprefix = Config->GetBlock("options")->Get<const Anope::string &>("guestnickprefix");
|
||||
const Anope::string &guestprefix = Config->GetBlock("options")->Get<const Anope::string>("guestnickprefix");
|
||||
|
||||
Anope::string guestnick;
|
||||
|
||||
|
||||
+2
-2
@@ -25,11 +25,11 @@ Serialize::Checker<std::multimap<Anope::string, XLine *, ci::less> > XLineManage
|
||||
|
||||
void XLine::InitRegex()
|
||||
{
|
||||
if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && !Config->GetBlock("options")->Get<const Anope::string &>("regexengine").empty())
|
||||
if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && !Config->GetBlock("options")->Get<const Anope::string>("regexengine").empty())
|
||||
{
|
||||
Anope::string stripped_mask = this->mask.substr(1, this->mask.length() - 2);
|
||||
|
||||
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string &>("regexengine"));
|
||||
ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string>("regexengine"));
|
||||
if (provider)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user