diff options
author | Adam <Adam@anope.org> | 2014-12-10 02:09:51 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-12-10 02:09:51 -0500 |
commit | 50acad5ce451b44b469890fe46ce14c7ffd031ca (patch) | |
tree | 231101b9e475dacd58b4d03d1a69df9fe7a82f28 | |
parent | 3e5a5e1c669f6027b897f7358d45f92e1552f746 (diff) |
Unconst these config Get<Anope::string> calls as it makes no sense
66 files changed, 286 insertions, 286 deletions
diff --git a/include/config.h b/include/config.h index 455785096..fe4a6fded 100644 --- a/include/config.h +++ b/include/config.h @@ -46,7 +46,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<Anope::string>(tag, def); if (!value.empty()) try { diff --git a/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp index 2e26319b6..911ba2c76 100644 --- a/modules/bs_autoassign.cpp +++ b/modules/bs_autoassign.cpp @@ -20,7 +20,7 @@ class BSAutoAssign : public Module void OnChanRegistered(ChanServ::Channel *ci) override { - const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string>("bot"); + const Anope::string &bot = Config->GetModule(this)->Get<Anope::string>("bot"); if (bot.empty()) return; diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index f88904a46..e18ead579 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -703,7 +703,7 @@ class CSAKick : public Module mask = ak->GetMask(); reason = ak->GetReason(); if (reason.empty()) - reason = Language::Translate(u, Config->GetModule(this)->Get<const Anope::string>("autokickreason").c_str()); + reason = Language::Translate(u, Config->GetModule(this)->Get<Anope::string>("autokickreason").c_str()); if (reason.empty()) reason = Language::Translate(u, _("User has been banned from the channel")); return EVENT_STOP; diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 478a2f3d2..03edc28e9 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -489,13 +489,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<Anope::string>("name"); ChanServ::Privilege *p = ChanServ::service ? ChanServ::service->FindPrivilege(pname) : nullptr; if (p == NULL) continue; - const Anope::string &value = priv->Get<const Anope::string>("flag"); + const Anope::string &value = priv->Get<Anope::string>("flag"); if (value.empty()) continue; diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index 44c96d0ce..e3efaa547 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -158,10 +158,10 @@ class CommandCSList : public Command " {0} #51-100\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<Anope::string>("regexengine").empty()) { source.Reply(" "); - source.Reply(_("Regex matches are also supported using the {0} engine. Enclose your pattern in // if this is desired."), Config->GetBlock("options")->Get<const Anope::string>("regexengine")); + source.Reply(_("Regex matches are also supported using the {0} engine. Enclose your pattern in // if this is desired."), Config->GetBlock("options")->Get<Anope::string>("regexengine")); } return true; diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 6c7ca03d1..f8624ce76 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -364,9 +364,9 @@ class CSLog : public Module LogDefault ld; - ld.service = def->Get<const Anope::string>("service"); - ld.command = def->Get<const Anope::string>("command"); - ld.method = def->Get<const Anope::string>("method"); + ld.service = def->Get<Anope::string>("service"); + ld.command = def->Get<Anope::string>("command"); + ld.method = def->Get<Anope::string>("method"); defaults.push_back(ld); } diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index d26e113d6..b525f51a5 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -881,14 +881,14 @@ class CSMode : public Module { Configuration::Block *block = conf->GetBlock("command", i); - const Anope::string &cname = block->Get<const Anope::string>("name"), - &cmd = block->Get<const Anope::string>("command"); + const Anope::string &cname = block->Get<Anope::string>("name"), + &cmd = block->Get<Anope::string>("command"); if (cname.empty() || cmd != "chanserv/modes") continue; - const Anope::string &set = block->Get<const Anope::string>("set"), - &unset = block->Get<const Anope::string>("unset"); + const Anope::string &set = block->Get<Anope::string>("set"), + &unset = block->Get<Anope::string>("unset"); if (set.empty() && unset.empty()) continue; @@ -946,7 +946,7 @@ class CSMode : public Module void OnChanRegistered(ChanServ::Channel *ci) override { Anope::string mlock; - spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("mlock", "+nt")); + spacesepstream sep(Config->GetModule(this)->Get<Anope::string>("mlock", "+nt")); if (sep.GetToken(mlock)) { bool add = true; diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 48716b194..51cf44b79 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -189,11 +189,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<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<Anope::string>("name"); + Anope::string desc = block->Get<Anope::string>("misc_description"); if (cname.empty() || desc.empty()) continue; diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 38d03daf7..cc39ad8b9 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -618,13 +618,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<Anope::string>("name"); ChanServ::Privilege *p = ChanServ::service ? ChanServ::service->FindPrivilege(pname) : nullptr; if (p == NULL) continue; - const Anope::string &xop = block->Get<const Anope::string>("xop"); + const Anope::string &xop = block->Get<Anope::string>("xop"); if (pname.empty() || xop.empty()) continue; @@ -634,8 +634,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<Anope::string>("name"), + &cserv = block->Get<Anope::string>("command"); if (cname.empty() || cserv != "chanserv/xop") continue; diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index e3acf74f9..9a9b933f4 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -125,7 +125,7 @@ class CommandNSGroup : public Command } NickServ::Nick *target, *na = NickServ::FindNick(u->nick); - const Anope::string &guestnick = Config->GetModule("nickserv")->Get<const Anope::string>("guestnickprefix", "Guest"); + const Anope::string &guestnick = Config->GetModule("nickserv")->Get<Anope::string>("guestnickprefix", "Guest"); time_t reg_delay = Config->GetModule("nickserv")->Get<time_t>("regdelay"); unsigned maxaliases = Config->GetModule(this->owner)->Get<unsigned>("maxaliases"); if (!(target = NickServ::FindNick(nick))) diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index e5dd56562..3307f6fed 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -163,7 +163,7 @@ class CommandNSList : public Command " {0} #51-100\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<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index 1c601e2a2..b13a945a6 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -111,7 +111,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<Anope::string>("registration"); if (Anope::ReadOnly) { @@ -138,7 +138,7 @@ class CommandNSRegister : public Command /* Guest nick can now have a series of between 1 and 7 digits. * --lara */ - const Anope::string &guestnick = Config->GetModule("nickserv")->Get<const Anope::string>("guestnickprefix", "Guest"); + const Anope::string &guestnick = Config->GetModule("nickserv")->Get<Anope::string>("guestnickprefix", "Guest"); 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(_("\002{0}\002 may not be registered."), u_nick); @@ -284,7 +284,7 @@ class CommandNSResend : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { - if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) + if (!Config->GetModule(this->owner)->Get<Anope::string>("registration").equals_ci("mail")) { source.Reply(_("Access denied.")); return; @@ -323,7 +323,7 @@ class CommandNSResend : public Command bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { - if (!Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) + if (!Config->GetModule(this->owner)->Get<Anope::string>("registration").equals_ci("mail")) return false; source.Reply(_("This command will resend you the registration confirmation email.")); @@ -332,7 +332,7 @@ class CommandNSResend : public Command void OnServHelp(CommandSource &source) override { - if (Config->GetModule(this->owner)->Get<const Anope::string>("registration").equals_ci("mail")) + if (Config->GetModule(this->owner)->Get<Anope::string>("registration").equals_ci("mail")) Command::OnServHelp(source); } }; @@ -358,7 +358,7 @@ class NSRegister : public Module , unconfirmed(this, NickServ::account, "UNCONFIRMED") , passcode(this, NickServ::account, "passcode") { - if (Config->GetModule(this)->Get<const Anope::string>("registration").equals_ci("disable")) + if (Config->GetModule(this)->Get<Anope::string>("registration").equals_ci("disable")) throw ModuleException("Module " + this->name + " will not load with registration disabled."); } @@ -367,7 +367,7 @@ class NSRegister : public Module ServiceBot *NickServ; if (unconfirmed.HasExt(u->Account()) && (NickServ = Config->GetClient("NickServ"))) { - const Anope::string &nsregister = Config->GetModule(this)->Get<const Anope::string>("registration"); + const Anope::string &nsregister = Config->GetModule(this)->Get<Anope::string>("registration"); if (nsregister.equals_ci("admin")) u->SendMessage(NickServ, _("All new accounts must be validated by an administrator. Please wait for your registration to be confirmed.")); else @@ -399,15 +399,15 @@ static bool SendRegmail(User *u, NickServ::Nick *na, ServiceBot *bi) if (code == NULL) code = na->GetAccount()->Extend<Anope::string>("passcode", Anope::Random(9)); - Anope::string subject = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<const Anope::string>("registration_subject").c_str()), - message = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<const Anope::string>("registration_message").c_str()); + Anope::string subject = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<Anope::string>("registration_subject").c_str()), + message = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<Anope::string>("registration_message").c_str()); subject = subject.replace_all_cs("%n", na->GetNick()); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); subject = subject.replace_all_cs("%c", *code); message = message.replace_all_cs("%n", na->GetNick()); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); message = message.replace_all_cs("%c", *code); return Mail::Send(u, nc, bi, subject, message); diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index 2ee7f7a01..2680c9b42 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -122,16 +122,16 @@ class NSResetPass : public Module static bool SendResetEmail(User *u, NickServ::Nick *na, ServiceBot *bi) { - Anope::string subject = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<const Anope::string>("reset_subject").c_str()), - message = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<const Anope::string>("reset_message").c_str()), + Anope::string subject = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<Anope::string>("reset_subject").c_str()), + message = Language::Translate(na->GetAccount(), Config->GetBlock("mail")->Get<Anope::string>("reset_message").c_str()), passcode = Anope::Random(20); subject = subject.replace_all_cs("%n", na->GetNick()); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); subject = subject.replace_all_cs("%c", passcode); message = message.replace_all_cs("%n", na->GetNick()); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); message = message.replace_all_cs("%c", passcode); na->GetAccount()->Extend<ResetInfo>("reset", ResetInfo{passcode, Anope::CurTime}); diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index f60c23053..b04687b7b 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -400,15 +400,15 @@ class CommandNSSetEmail : public Command u->Account()->Extend<std::pair<Anope::string, Anope::string> >("ns_set_email", std::make_pair(new_email, code)); - Anope::string subject = Config->GetBlock("mail")->Get<const Anope::string>("emailchange_subject"), - message = Config->GetBlock("mail")->Get<const Anope::string>("emailchange_message"); + Anope::string subject = Config->GetBlock("mail")->Get<Anope::string>("emailchange_subject"), + message = Config->GetBlock("mail")->Get<Anope::string>("emailchange_message"); subject = subject.replace_all_cs("%e", u->Account()->GetEmail()); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); subject = subject.replace_all_cs("%c", code); message = message.replace_all_cs("%e", u->Account()->GetEmail()); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); message = message.replace_all_cs("%c", code); Anope::string old = u->Account()->GetEmail(); diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index a062f0511..eb94c0f13 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -201,13 +201,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<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<Anope::string>("name"); + Anope::string desc = block->Get<Anope::string>("misc_description"); if (cname.empty() || desc.empty()) continue; diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index d9d18a776..6330f2417 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -374,7 +374,7 @@ class CommandOSAKill : public Command " The default auto kill expiry time is \002{1}\002"), source.command, Anope::Duration(Config->GetModule("operserv")->Get<time_t>("autokillexpiry", "30d"), source.GetAccount())); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index 9e38d0779..ba893a960 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -362,26 +362,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<Anope::string>("level4"); + dconfig.defcons[3] = block->Get<Anope::string>("level3"); + dconfig.defcons[2] = block->Get<Anope::string>("level2"); + dconfig.defcons[1] = block->Get<Anope::string>("level1"); dconfig.sessionlimit = block->Get<int>("sessionlimit"); - dconfig.akillreason = block->Get<const Anope::string>("akillreason"); + dconfig.akillreason = block->Get<Anope::string>("akillreason"); dconfig.akillexpire = block->Get<time_t>("akillexpire"); - dconfig.chanmodes = block->Get<const Anope::string>("chanmodes"); + dconfig.chanmodes = block->Get<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<Anope::string>("message"); + dconfig.offmessage = block->Get<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<Anope::string>("sessionlimitexceeded"); + dconfig.sle_detailsloc = block->Get<Anope::string>("sessionlimitdetailsloc"); if (dconfig.defaultlevel < 1 || dconfig.defaultlevel > 5) throw ConfigException("The value for <defcon:defaultlevel> must be between 1 and 5"); diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 95ad737b3..be7f908bd 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -437,7 +437,7 @@ class CommandOSForbid : public Command { source.Reply(_("Forbid allows you to forbid usage of certain nicknames, channels, 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<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index e260ed7d0..03632f84d 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -354,7 +354,7 @@ class CommandOSIgnore : public Command " When adding a \037mask\037, it should be in the format nick!user@host, everything else will be considered a nicknames. Wildcards are permitted."), source.command); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_list.cpp b/modules/commands/os_list.cpp index ea88b12ff..ed825f373 100644 --- a/modules/commands/os_list.cpp +++ b/modules/commands/os_list.cpp @@ -102,7 +102,7 @@ class CommandOSChanList : public Command "If \002pattern\002 is given, lists only channels that match it. If a nicknam is given, lists only the channels the user using it is on." " If SECRET is specified, lists only channels matching \002pattern\002 that have the +s or +p mode.")); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); @@ -209,7 +209,7 @@ class CommandOSUserList : public Command "If \002pattern\002 is given, lists only users that match it (it must be in the format nick!user@host)." " If \002channel\002 is given, lists only users that are on the given channel. If INVISIBLE is specified, only users 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<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/commands/os_logsearch.cpp b/modules/commands/os_logsearch.cpp index fe2c95365..0fa425aba 100644 --- a/modules/commands/os_logsearch.cpp +++ b/modules/commands/os_logsearch.cpp @@ -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<Anope::string>("logname"); std::list<Anope::string> matches; for (int d = days - 1; d >= 0; --d) { diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index 547952ea6..ecee31520 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -375,9 +375,9 @@ class OSNews : public Module ServiceBot *bi = NULL; if (Type == NEWS_OPER) - bi = ServiceBot::Find(Config->GetModule(this)->Get<const Anope::string>("oper_announcer", "OperServ"), true); + bi = ServiceBot::Find(Config->GetModule(this)->Get<Anope::string>("oper_announcer", "OperServ"), true); else - bi = ServiceBot::Find(Config->GetModule(this)->Get<const Anope::string>("announcer", "Global"), true); + bi = ServiceBot::Find(Config->GetModule(this)->Get<Anope::string>("announcer", "Global"), true); if (bi == NULL) return; @@ -437,8 +437,8 @@ class OSNews : public Module void OnReload(Configuration::Conf *conf) override { - oper_announcer = conf->GetModule(this)->Get<const Anope::string>("oper_announcer", "OperServ"); - announcer = conf->GetModule(this)->Get<const Anope::string>("announcer", "Global"); + oper_announcer = conf->GetModule(this)->Get<Anope::string>("oper_announcer", "OperServ"); + announcer = conf->GetModule(this)->Get<Anope::string>("announcer", "Global"); news_count = conf->GetModule(this)->Get<unsigned>("newscount", "3"); } diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index e33b89756..e78d3fd9e 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -693,8 +693,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<Anope::string>("sessionlimitexceeded"); + sle_detailsloc = block->Get<Anope::string>("sessionlimitdetailsloc"); max_exception_limit = block->Get<int>("maxsessionlimit"); exception_expiry = block->Get<time_t>("exceptionexpiry"); diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 368d118ec..b5025203f 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -379,7 +379,7 @@ class CommandOSSNLine : public CommandOSSXLineBase " Because the real name may contain spaces, the separator between it and the reason is a \002colon\002."), source.command, Anope::Duration(Config->GetModule("operserv")->Get<time_t>("snlineexpiry", "30d"), source.GetAccount())); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); @@ -609,7 +609,7 @@ class CommandOSSQLine : public CommandOSSXLineBase " The default {0} expiry time is \002{1}\002."), source.command, Anope::Duration(Config->GetModule("operserv")->Get<time_t>("sqlineexpiry", "30d"), source.GetAccount())); - const Anope::string ®exengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine"); + const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) { source.Reply(" "); diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index 61c6645cb..9872c8b2e 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -31,7 +31,7 @@ class DBFlatFile : public Module const std::map<Anope::string, Serialize::TypeBase *> &types = Serialize::TypeBase::GetTypes(); std::set<Anope::string> dbs; - dbs.insert(Config->GetModule(this)->Get<const Anope::string>("database", "anope.db")); + dbs.insert(Config->GetModule(this)->Get<Anope::string>("database", "anope.db")); for (const std::pair<Anope::string, Serialize::TypeBase *> &p : types) { diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index 7058bcd2b..2e13342a9 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -1374,7 +1374,7 @@ class DBOld : public Module , mlock_limit(this, "mlock_limit") , mlock_key(this, "mlock_key") { - hashm = Config->GetModule(this)->Get<const Anope::string>("hash"); + hashm = Config->GetModule(this)->Get<Anope::string>("hash"); if (hashm != "md5" && hashm != "oldmd5" && hashm != "sha1" && hashm != "plain" && hashm != "sha256") throw ModuleException("Invalid hash method"); diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index fe22f6394..8f3e136e3 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -63,8 +63,8 @@ class DBMySQL : public Module, public Pipe void OnReload(Configuration::Conf *conf) 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<Anope::string>("engine")); + this->prefix = block->Get<Anope::string>("prefix", "anope_db_"); inited = false; } diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index a5a6b0e3f..989f21f22 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -482,7 +482,7 @@ class ModuleLDAP : public Module, public Pipe ++it; for (i = 0; i < conf->CountBlock("ldap"); ++i) - if (conf->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname) + if (conf->GetBlock("ldap", i)->Get<Anope::string>("name", "ldap/main") == cname) break; if (i == conf->CountBlock("ldap")) @@ -499,14 +499,14 @@ class ModuleLDAP : public Module, public Pipe { Configuration::Block *ldap = conf->GetBlock("ldap", i); - const Anope::string &connname = ldap->Get<const Anope::string>("name", "ldap/main"); + const Anope::string &connname = ldap->Get<Anope::string>("name", "ldap/main"); if (this->LDAPServices.find(connname) == this->LDAPServices.end()) { - const Anope::string &server = ldap->Get<const Anope::string>("server", "127.0.0.1"); + const Anope::string &server = ldap->Get<Anope::string>("server", "127.0.0.1"); int port = ldap->Get<int>("port", "389"); - const Anope::string &admin_binddn = ldap->Get<const Anope::string>("admin_binddn"); - const Anope::string &admin_password = ldap->Get<const Anope::string>("admin_password"); + const Anope::string &admin_binddn = ldap->Get<Anope::string>("admin_binddn"); + const Anope::string &admin_password = ldap->Get<Anope::string>("admin_password"); time_t timeout = ldap->Get<time_t>("timeout", "5"); try diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index dbd0344de..11d825b18 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -239,14 +239,14 @@ class NSIdentifyLDAP : public Module { Configuration::Block *conf = 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<Anope::string>("basedn"); + search_filter = conf->Get<Anope::string>("search_filter"); + object_class = conf->Get<Anope::string>("object_class"); + username_attribute = conf->Get<Anope::string>("username_attribute"); + this->password_attribute = conf->Get<Anope::string>("password_attribute"); + email_attribute = conf->Get<Anope::string>("email_attribute"); + this->disable_register_reason = conf->Get<Anope::string>("disable_register_reason"); + this->disable_email_reason = conf->Get<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 */ diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index d999d90b6..e6460b8cd 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -100,11 +100,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<Anope::string>("binddn"); + this->password = config->Get<Anope::string>("password"); + this->basedn = config->Get<Anope::string>("basedn"); + this->filter = config->Get<Anope::string>("filter"); + opertype_attribute = config->Get<Anope::string>("opertype_attribute"); for (std::set<Oper *>::iterator it = my_opers.begin(), it_end = my_opers.end(); it != it_end; ++it) delete *it; diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index e19813354..1b8f4b6e8 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -216,7 +216,7 @@ class ModuleSQL : public Module ++it; for (i = 0; i < config->CountBlock("mysql"); ++i) - if (config->GetBlock("mysql", i)->Get<const Anope::string>("name", "mysql/main") == cname) + if (config->GetBlock("mysql", i)->Get<Anope::string>("name", "mysql/main") == cname) break; if (i == config->CountBlock("mysql")) @@ -231,14 +231,14 @@ class ModuleSQL : public Module for (int 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<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<Anope::string>("database", "anope"); + const Anope::string &server = block->Get<Anope::string>("server", "127.0.0.1"); + const Anope::string &user = block->Get<Anope::string>("username", "anope"); + const Anope::string &password = block->Get<Anope::string>("password"); int port = block->Get<int>("port", "3306"); try diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 8b673d6cf..16a84f7c2 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -88,9 +88,9 @@ class ModuleSQLAuthentication : public Module void OnReload(Configuration::Conf *conf) 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<Anope::string>("engine"); + this->query = config->Get<Anope::string>("query"); + this->disable_reason = config->Get<Anope::string>("disable_reason"); this->disable_email_reason = config->Get<Anope::string>("disable_email_reason"); this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); diff --git a/modules/extra/m_sql_log.cpp b/modules/extra/m_sql_log.cpp index d7cee3913..313584281 100644 --- a/modules/extra/m_sql_log.cpp +++ b/modules/extra/m_sql_log.cpp @@ -25,7 +25,7 @@ class SQLLog : public Module void OnReload(Configuration::Conf *conf) override { Configuration::Block *config = conf->GetModule(this); - this->table = config->Get<const Anope::string>("table", "logs"); + this->table = config->Get<Anope::string>("table", "logs"); } void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) override diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp index b182370c9..6bddbf0eb 100644 --- a/modules/extra/m_sql_oper.cpp +++ b/modules/extra/m_sql_oper.cpp @@ -121,8 +121,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<Anope::string>("engine"); + this->query = config->Get<Anope::string>("query"); this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); } diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index 19d95c248..9370a0d77 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -115,7 +115,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<Anope::string>("name", "sqlite/main") == cname) break; if (i == num) @@ -130,11 +130,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<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<Anope::string>("database", "anope"); try { diff --git a/modules/extra/m_ssl_gnutls.cpp b/modules/extra/m_ssl_gnutls.cpp index 23e8211dd..6682da094 100644 --- a/modules/extra/m_ssl_gnutls.cpp +++ b/modules/extra/m_ssl_gnutls.cpp @@ -339,9 +339,9 @@ class GnuTLSModule : public Module { Configuration::Block *config = conf->GetModule(this); - const Anope::string certfile = config->Get<const Anope::string>("cert", "data/anope.crt"); - const Anope::string keyfile = config->Get<const Anope::string>("key", "data/anope.key"); - const Anope::string dhfile = config->Get<const Anope::string>("dh", "data/dhparams.pem"); + const Anope::string certfile = config->Get<Anope::string>("cert", "data/anope.crt"); + const Anope::string keyfile = config->Get<Anope::string>("key", "data/anope.key"); + const Anope::string dhfile = config->Get<Anope::string>("dh", "data/dhparams.pem"); CheckFile(certfile); CheckFile(keyfile); diff --git a/modules/extra/m_ssl_openssl.cpp b/modules/extra/m_ssl_openssl.cpp index 4462f84c5..5b4e68ecf 100644 --- a/modules/extra/m_ssl_openssl.cpp +++ b/modules/extra/m_ssl_openssl.cpp @@ -133,8 +133,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<Anope::string>("cert", "data/anope.crt"); + this->keyfile = config->Get<Anope::string>("key", "data/anope.key"); if (Anope::IsFile(this->certfile.c_str())) { diff --git a/modules/extra/stats/cs_fantasy_stats.cpp b/modules/extra/stats/cs_fantasy_stats.cpp index a5ce54d33..118a7e496 100644 --- a/modules/extra/stats/cs_fantasy_stats.cpp +++ b/modules/extra/stats/cs_fantasy_stats.cpp @@ -75,8 +75,8 @@ class CSStats : public Module void OnReload(Configuration::Conf *conf) override { - prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix", "anope_"); - this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<const Anope::string>("engine")); + prefix = conf->GetModule("m_chanstats")->Get<Anope::string>("prefix", "anope_"); + this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<Anope::string>("engine")); } SQL::Result RunQuery(const SQL::Query &query) diff --git a/modules/extra/stats/cs_fantasy_top.cpp b/modules/extra/stats/cs_fantasy_top.cpp index 94197a0e5..82480ffc3 100644 --- a/modules/extra/stats/cs_fantasy_top.cpp +++ b/modules/extra/stats/cs_fantasy_top.cpp @@ -100,8 +100,8 @@ class CSTop : public Module void OnReload(Configuration::Conf *conf) override { - prefix = conf->GetModule("m_chanstats")->Get<const Anope::string>("prefix", "anope_"); - this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<const Anope::string>("engine")); + prefix = conf->GetModule("m_chanstats")->Get<Anope::string>("prefix", "anope_"); + this->sql = ServiceReference<SQL::Provider>("SQL::Provider", conf->GetModule("m_chanstats")->Get<Anope::string>("engine")); } SQL::Result RunQuery(const SQL::Query &query) diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp index bc302c575..fbb56f4a7 100644 --- a/modules/extra/stats/irc2sql/irc2sql.cpp +++ b/modules/extra/stats/irc2sql/irc2sql.cpp @@ -11,18 +11,18 @@ void IRC2SQL::OnShutdown() void IRC2SQL::OnReload(Configuration::Conf *conf) { Configuration::Block *block = Config->GetModule(this); - prefix = block->Get<const Anope::string>("prefix", "anope_"); - GeoIPDB = block->Get<const Anope::string>("geoip_database"); + prefix = block->Get<Anope::string>("prefix", "anope_"); + GeoIPDB = block->Get<Anope::string>("geoip_database"); ctcpuser = block->Get<bool>("ctcpuser", "no"); ctcpeob = block->Get<bool>("ctcpeob", "yes"); - Anope::string engine = block->Get<const Anope::string>("engine"); + Anope::string engine = block->Get<Anope::string>("engine"); this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine); if (sql) this->CheckTables(); else Log() << "IRC2SQL: no database connection to " << engine; - const Anope::string &snick = block->Get<const Anope::string>("client"); + const Anope::string &snick = block->Get<Anope::string>("client"); if (snick.empty()) throw ConfigException(Module::name + ": <client> must be defined"); StatServ = ServiceBot::Find(snick, true); diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 1d299ce7a..331b1480b 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -487,13 +487,13 @@ class MChanstats : public Module void OnReload(Configuration::Conf *conf) 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<Anope::string>("prefix", "anope_"); + SmileysHappy = block->Get<Anope::string>("SmileysHappy"); + SmileysSad = block->Get<Anope::string>("SmileysSad"); + SmileysOther = block->Get<Anope::string>("SmileysOther"); NSDefChanstats = block->Get<bool>("ns_def_chanstats"); CSDefChanstats = block->Get<bool>("cs_def_chanstats"); - Anope::string engine = block->Get<const Anope::string>("engine"); + Anope::string engine = block->Get<Anope::string>("engine"); this->sql = ServiceReference<SQL::Provider>("SQL::Provider", engine); if (sql) this->CheckTables(); diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp index 4122987d2..5602522ff 100644 --- a/modules/fantasy.cpp +++ b/modules/fantasy.cpp @@ -77,7 +77,7 @@ class CommandBSSetFantasy : public Command "Note that users wanting to use fantaisist\n" "commands MUST have enough access for both\n" "the FANTASIA and the command they are executing."), - Config->GetModule(this->owner)->Get<const Anope::string>("fantasycharacter", "!").c_str()); + Config->GetModule(this->owner)->Get<Anope::string>("fantasycharacter", "!").c_str()); return true; } }; @@ -117,7 +117,7 @@ class Fantasy : public Module if (!msg.find(c->ci->GetBot()->nick)) params.erase(params.begin()); - else if (!msg.find_first_of(Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!"))) + else if (!msg.find_first_of(Config->GetModule(this)->Get<Anope::string>("fantasycharacter", "!"))) params[0].erase(params[0].begin()); else return; diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp index 0fa753dcf..5c096f8d8 100644 --- a/modules/m_dns.cpp +++ b/modules/m_dns.cpp @@ -1038,12 +1038,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<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<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<Anope::string>("admin", "admin@example.com"); + nameservers = block->Get<Anope::string>("nameservers", "ns1.example.com"); refresh = block->Get<int>("refresh", "3600"); for (int i = 0; i < block->CountBlock("notify"); ++i) diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp index 5ec4239e0..8bc549b0f 100644 --- a/modules/m_dnsbl.cpp +++ b/modules/m_dnsbl.cpp @@ -60,7 +60,7 @@ class DNSBLResolver : public Request reason = reason.replace_all_cs("%h", user->host); reason = reason.replace_all_cs("%i", addr); 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<Anope::string>("networkname")); ServiceBot *OperServ = Config->GetClient("OperServ"); Log(creator, "dnsbl", OperServ) << user->GetMask() << " (" << addr << ") appears in " << this->blacklist.name; @@ -113,15 +113,15 @@ class ModuleDNSBL : public Module { Configuration::Block *bl = block->GetBlock("blacklist", i); - Anope::string bname = bl->Get<const Anope::string>("name"); + Anope::string bname = bl->Get<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<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<Anope::string>(stringify(j)); if (!k.empty()) replies[j] = k; } diff --git a/modules/m_helpchan.cpp b/modules/m_helpchan.cpp index 1dec096e2..b8efe1b0a 100644 --- a/modules/m_helpchan.cpp +++ b/modules/m_helpchan.cpp @@ -18,7 +18,7 @@ class HelpChannel : public Module EventReturn OnChannelModeSet(Channel *c, const MessageSource &, ChannelMode *mode, const Anope::string ¶m) override { - if (mode->name == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string>("helpchannel"))) + if (mode->name == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<Anope::string>("helpchannel"))) { User *u = User::Find(param); diff --git a/modules/m_httpd.cpp b/modules/m_httpd.cpp index 8498ba2a2..f3125654f 100644 --- a/modules/m_httpd.cpp +++ b/modules/m_httpd.cpp @@ -370,15 +370,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<Anope::string>("name", "httpd/main"); existing.insert(hname); - Anope::string ip = block->Get<const Anope::string>("ip"); + Anope::string ip = block->Get<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<Anope::string>("extforward_ip"); + Anope::string ext_header = block->Get<Anope::string>("extforward_header"); if (ip.empty()) { diff --git a/modules/m_proxyscan.cpp b/modules/m_proxyscan.cpp index 782ae0d08..c8f73b403 100644 --- a/modules/m_proxyscan.cpp +++ b/modules/m_proxyscan.cpp @@ -255,7 +255,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<Anope::string>("target_ip"); if (s_target_ip.empty()) throw ConfigException(this->name + " target_ip may not be empty"); @@ -263,7 +263,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<Anope::string>("listen_ip"); if (s_listen_ip.empty()) throw ConfigException(this->name + " listen_ip may not be empty"); @@ -275,12 +275,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<Anope::string>("connect_notice"); + this->con_source = config->Get<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<Anope::string>("networkname") + " proxy check"; delete this->listener; this->listener = NULL; try @@ -299,7 +299,7 @@ class ModuleProxyScan : public Module ProxyCheck p; Anope::string token; - commasepstream sep(block->Get<const Anope::string>("type")); + commasepstream sep(block->Get<Anope::string>("type")); while (sep.GetToken(token)) { if (!token.equals_ci("HTTP") && !token.equals_ci("SOCKS5")) @@ -309,7 +309,7 @@ class ModuleProxyScan : public Module if (p.types.empty()) continue; - commasepstream sep2(block->Get<const Anope::string>("port")); + commasepstream sep2(block->Get<Anope::string>("port")); while (sep2.GetToken(token)) { try @@ -323,7 +323,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<Anope::string>("reason"); if (p.reason.empty()) continue; diff --git a/modules/m_redis.cpp b/modules/m_redis.cpp index a98b94476..5fab9706c 100644 --- a/modules/m_redis.cpp +++ b/modules/m_redis.cpp @@ -532,8 +532,8 @@ class ModuleRedis : public Module { Configuration::Block *redis = block->GetBlock("redis", i); - const Anope::string &n = redis->Get<const Anope::string>("name"), - &ip = redis->Get<const Anope::string>("ip"); + const Anope::string &n = redis->Get<Anope::string>("name"), + &ip = redis->Get<Anope::string>("ip"); int port = redis->Get<int>("port"); unsigned db = redis->Get<unsigned>("db"); diff --git a/modules/m_rewrite.cpp b/modules/m_rewrite.cpp index 7e8bbf9eb..37c58d5a9 100644 --- a/modules/m_rewrite.cpp +++ b/modules/m_rewrite.cpp @@ -171,10 +171,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<Anope::string>("service"); + rw.source_message = block->Get<Anope::string>("rewrite_source"); + rw.target_message = block->Get<Anope::string>("rewrite_target"); + rw.desc = block->Get<Anope::string>("rewrite_description"); if (rw.client.empty() || rw.source_message.empty() || rw.target_message.empty()) continue; diff --git a/modules/m_xmlrpc.cpp b/modules/m_xmlrpc.cpp index e92650a89..3830b2ac8 100644 --- a/modules/m_xmlrpc.cpp +++ b/modules/m_xmlrpc.cpp @@ -179,7 +179,7 @@ class ModuleXMLRPC : public Module void OnReload(Configuration::Conf *conf) override { - this->httpref = ServiceReference<HTTPProvider>("HTTPProvider", conf->GetModule(this)->Get<const Anope::string>("server", "httpd/main")); + this->httpref = ServiceReference<HTTPProvider>("HTTPProvider", conf->GetModule(this)->Get<Anope::string>("server", "httpd/main")); } }; diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 8d07fe108..f74a30137 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -934,7 +934,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<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."; } diff --git a/modules/pseudoclients/botserv/botserv.cpp b/modules/pseudoclients/botserv/botserv.cpp index 312b2a9d5..5f07700b2 100644 --- a/modules/pseudoclients/botserv/botserv.cpp +++ b/modules/pseudoclients/botserv/botserv.cpp @@ -46,7 +46,7 @@ class BotServCore : public Module, public BotServ::BotServService void OnReload(Configuration::Conf *conf) override { - const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &bsnick = conf->GetModule(this)->Get<Anope::string>("client"); BotServ = ServiceBot::Find(bsnick, true); } @@ -55,7 +55,7 @@ class BotServCore : public Module, public BotServ::BotServService /* Do not allow removing bot modes on our service bots */ if (chan->ci && chan->ci->GetBot() == user) { - const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string>("botmodes"); + const Anope::string &botmodes = Config->GetModule(this)->Get<Anope::string>("botmodes"); for (unsigned i = 0; i < botmodes.length(); ++i) chan->SetMode(chan->ci->GetBot(), ModeManager::FindChannelModeByChar(botmodes[i]), chan->ci->GetBot()->GetUID()); } @@ -65,7 +65,7 @@ class BotServCore : public Module, public BotServ::BotServService { if (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<Anope::string>("botmodes")); bi->Join(ci->c, &status); } } @@ -119,7 +119,7 @@ class BotServCore : public Module, public BotServ::BotServService /* This is before the user has joined the channel, so check usercount + 1 */ if (c->users.size() + 1 >= Config->GetModule(this)->Get<unsigned>("minusers") && !c->FindUser(c->ci->GetBot())) { - ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes")); + ChannelStatus status(Config->GetModule(this)->Get<Anope::string>("botmodes")); c->ci->GetBot()->Join(c, &status); } } @@ -158,7 +158,7 @@ class BotServCore : public Module, public BotServ::BotServService "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("fantasy")->Get<const Anope::string>("fantasycharacter", "!"); + const Anope::string &fantasycharacters = Config->GetModule("fantasy")->Get<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()); @@ -189,7 +189,7 @@ class BotServCore : public Module, public BotServ::BotServService 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("fantasy")->Get<const Anope::string>("fantasycharacter", "!"); + const Anope::string &fantasycharacters = Config->GetModule("fantasy")->Get<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" @@ -213,7 +213,7 @@ class BotServCore : public Module, public BotServ::BotServService void OnCreateChan(ChanServ::Channel *ci) override { /* Set default bot flags */ - spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy")); + spacesepstream sep(Config->GetModule(this)->Get<Anope::string>("defaults", "greet fantasy")); for (Anope::string token; sep.GetToken(token);) ci->SetS<bool>("BS_" + token.upper(), true); } @@ -229,7 +229,7 @@ class BotServCore : public Module, public BotServ::BotServService void OnCreateBot(ServiceBot *bi) override { if (bi->botmodes.empty()) - bi->botmodes = Config->GetModule(this)->Get<const Anope::string>("botumodes"); + bi->botmodes = Config->GetModule(this)->Get<Anope::string>("botumodes"); } }; diff --git a/modules/pseudoclients/chanserv/chanserv.cpp b/modules/pseudoclients/chanserv/chanserv.cpp index dbd7f14eb..3824f9fe2 100644 --- a/modules/pseudoclients/chanserv/chanserv.cpp +++ b/modules/pseudoclients/chanserv/chanserv.cpp @@ -258,7 +258,7 @@ class ChanServCore : public Module void OnReload(Configuration::Conf *conf) override { - const Anope::string &channick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &channick = conf->GetModule(this)->Get<Anope::string>("client"); if (channick.empty()) throw ConfigException(Module::name + ": <client> must be defined"); @@ -274,8 +274,8 @@ class ChanServCore : public Module { Configuration::Block *privilege = conf->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<Anope::string>("name"), + &desc = privilege->Get<Anope::string>("desc"); int rank = privilege->Get<int>("rank"); Anope::string value = privilege->Get<Anope::string>("level"); int level; @@ -289,7 +289,7 @@ class ChanServCore : public Module AddPrivilege(ChanServ::Privilege(nname, desc, rank, level)); } - spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy")).GetTokens(defaults); + spacesepstream(conf->GetModule(this)->Get<Anope::string>("defaults", "greet fantasy")).GetTokens(defaults); if (defaults.empty()) { defaults.push_back("KEEPTOPIC"); @@ -419,7 +419,7 @@ class ChanServCore : public Module { ci->c->RemoveMode(ci->WhoSends(), "REGISTERED", "", false); - const Anope::string &require = Config->GetModule(this)->Get<const Anope::string>("require"); + const Anope::string &require = Config->GetModule(this)->Get<Anope::string>("require"); if (!require.empty()) ci->c->SetModes(ci->WhoSends(), false, "-%s", require.c_str()); } @@ -467,7 +467,7 @@ class ChanServCore : public Module else c->RemoveMode(c->ci->WhoSends(), "REGISTERED", "", false); - const Anope::string &require = Config->GetModule(this)->Get<const Anope::string>("require"); + const Anope::string &require = Config->GetModule(this)->Get<Anope::string>("require"); if (!require.empty()) { if (c->ci) @@ -486,8 +486,8 @@ class ChanServCore : public Module EventReturn OnCanSet(User *u, const ChannelMode *cm) override { - if (Config->GetModule(this)->Get<const Anope::string>("nomlock").find(cm->mchar) != Anope::string::npos - || Config->GetModule(this)->Get<const Anope::string>("require").find(cm->mchar) != Anope::string::npos) + if (Config->GetModule(this)->Get<Anope::string>("nomlock").find(cm->mchar) != Anope::string::npos + || Config->GetModule(this)->Get<Anope::string>("require").find(cm->mchar) != Anope::string::npos) return EVENT_STOP; return EVENT_CONTINUE; } @@ -579,7 +579,7 @@ class ChanServCore : public Module ci->WhoSends()->Assign(NULL, ci); if (ci->c->FindUser(ci->GetBot()) == NULL) { - ChannelStatus status(Config->GetModule("botserv")->Get<const Anope::string>("botmodes")); + ChannelStatus status(Config->GetModule("botserv")->Get<Anope::string>("botmodes")); ci->GetBot()->Join(ci->c, &status); } } diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index 108495c42..307785e39 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -61,7 +61,7 @@ class GlobalCore : public Module void OnReload(Configuration::Conf *conf) override { - const Anope::string &glnick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &glnick = conf->GetModule(this)->Get<Anope::string>("client"); if (glnick.empty()) throw ConfigException(Module::name + ": <client> must be defined"); @@ -75,21 +75,21 @@ class GlobalCore : public Module void OnRestart() override { - const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown"); + const Anope::string &gl = Config->GetModule(this)->Get<Anope::string>("globaloncycledown"); if (!gl.empty()) this->SendGlobal(Global, "", gl); } void OnShutdown() override { - const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycledown"); + const Anope::string &gl = Config->GetModule(this)->Get<Anope::string>("globaloncycledown"); if (!gl.empty()) this->SendGlobal(Global, "", gl); } void OnNewServer(Server *s) override { - const Anope::string &gl = Config->GetModule(this)->Get<const Anope::string>("globaloncycleup"); + const Anope::string &gl = Config->GetModule(this)->Get<Anope::string>("globaloncycleup"); if (!gl.empty() && !Me->IsSynced()) s->Notice(Global, gl); } diff --git a/modules/pseudoclients/hostserv.cpp b/modules/pseudoclients/hostserv.cpp index 03fe451d4..1b42944c3 100644 --- a/modules/pseudoclients/hostserv.cpp +++ b/modules/pseudoclients/hostserv.cpp @@ -37,7 +37,7 @@ class HostServCore : public Module void OnReload(Configuration::Conf *conf) override { - const Anope::string &hsnick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &hsnick = conf->GetModule(this)->Get<Anope::string>("client"); if (hsnick.empty()) throw ConfigException(Module::name + ": <client> must be defined"); diff --git a/modules/pseudoclients/memoserv/memoserv.cpp b/modules/pseudoclients/memoserv/memoserv.cpp index 7952ed637..f83d23399 100644 --- a/modules/pseudoclients/memoserv/memoserv.cpp +++ b/modules/pseudoclients/memoserv/memoserv.cpp @@ -41,20 +41,20 @@ class MemoServCore : public Module, public MemoServ::MemoServService bool SendMemoMail(NickServ::Account *nc, MemoServ::MemoInfo *mi, MemoServ::Memo *m) { - Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()), - message = Language::Translate(Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str()); + Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<Anope::string>("memo_subject").c_str()), + message = Language::Translate(Config->GetBlock("mail")->Get<Anope::string>("memo_message").c_str()); subject = subject.replace_all_cs("%n", nc->GetDisplay()); subject = subject.replace_all_cs("%s", m->GetSender()); subject = subject.replace_all_cs("%d", stringify(mi->GetIndex(m) + 1)); subject = subject.replace_all_cs("%t", m->GetText()); - subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + subject = subject.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); message = message.replace_all_cs("%n", nc->GetDisplay()); message = message.replace_all_cs("%s", m->GetSender()); message = message.replace_all_cs("%d", stringify(mi->GetIndex(m) + 1)); message = message.replace_all_cs("%t", m->GetText()); - message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<const Anope::string>("networkname")); + message = message.replace_all_cs("%N", Config->GetBlock("networkinfo")->Get<Anope::string>("networkname")); return Mail::Send(nc, subject, message); } @@ -220,7 +220,7 @@ class MemoServCore : public Module, public MemoServ::MemoServService void OnReload(Configuration::Conf *conf) override { - const Anope::string &msnick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &msnick = conf->GetModule(this)->Get<Anope::string>("client"); if (msnick.empty()) throw ConfigException(Module::name + ": <client> must be defined"); diff --git a/modules/pseudoclients/nickserv/nickserv.cpp b/modules/pseudoclients/nickserv/nickserv.cpp index 23652c71d..8e2b9bf7c 100644 --- a/modules/pseudoclients/nickserv/nickserv.cpp +++ b/modules/pseudoclients/nickserv/nickserv.cpp @@ -75,8 +75,8 @@ class NickServRelease : public User, public Timer Anope::string nick; public: - NickServRelease(Module *me, NickServ::Nick *na, time_t delay) : User(na->GetNick(), Config->GetModule("nickserv")->Get<const Anope::string>("enforceruser", "user"), - Config->GetModule("nickserv")->Get<const Anope::string>("enforcerhost", "services.localhost.net"), "", "", Me, "Services Enforcer", Anope::CurTime, "", IRCD->UID_Retrieve(), NULL), Timer(me, delay), nick(na->GetNick()) + NickServRelease(Module *me, NickServ::Nick *na, time_t delay) : User(na->GetNick(), Config->GetModule("nickserv")->Get<Anope::string>("enforceruser", "user"), + Config->GetModule("nickserv")->Get<Anope::string>("enforcerhost", "services.localhost.net"), "", "", Me, "Services Enforcer", Anope::CurTime, "", IRCD->UID_Retrieve(), NULL), Timer(me, delay), nick(na->GetNick()) { /* Erase the current release timer and use the new one */ Anope::map<NickServRelease *>::iterator nit = NickServReleases.find(this->nick); @@ -282,7 +282,7 @@ class NickServCore : public Module, public NickServ::NickServService if (IRCD->CanSVSNick) { unsigned nicklen = Config->GetBlock("networkinfo")->Get<unsigned>("nicklen"); - const Anope::string &guestprefix = Config->GetModule("nickserv")->Get<const Anope::string>("guestnickprefix", "Guest"); + const Anope::string &guestprefix = Config->GetModule("nickserv")->Get<Anope::string>("guestnickprefix", "Guest"); Anope::string guestnick; @@ -369,7 +369,7 @@ class NickServCore : public Module, public NickServ::NickServService void OnReload(Configuration::Conf *conf) override { - const Anope::string &nsnick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &nsnick = conf->GetModule(this)->Get<Anope::string>("client"); if (nsnick.empty()) throw ConfigException(Module::name + ": <client> must be defined"); @@ -380,7 +380,7 @@ class NickServCore : public Module, public NickServ::NickServService NickServ = bi; - spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "ns_secure memo_signon memo_receive")).GetTokens(defaults); + spacesepstream(conf->GetModule(this)->Get<Anope::string>("defaults", "ns_secure memo_signon memo_receive")).GetTokens(defaults); if (defaults.empty()) { defaults.push_back("NS_SECURE"); @@ -436,7 +436,7 @@ class NickServCore : public Module, public NickServ::NickServService c->SetCorrectModes(u, true); } - const Anope::string &modesonid = block->Get<const Anope::string>("modesonid"); + const Anope::string &modesonid = block->Get<Anope::string>("modesonid"); if (!modesonid.empty()) u->SetModes(NickServ, "%s", modesonid.c_str()); @@ -475,7 +475,7 @@ class NickServCore : public Module, public NickServ::NickServService const NickServ::Nick *na = NickServ::FindNick(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<Anope::string>("unregistered_notice"); if (!Config->GetModule("nickserv")->Get<bool>("nonicknameownership") && !unregistered_notice.empty() && !na && !u->Account()) u->SendMessage(*NickServ, unregistered_notice); else if (na && !u->IsIdentified(true)) diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp index 4a81686e4..9f407e059 100644 --- a/modules/pseudoclients/operserv.cpp +++ b/modules/pseudoclients/operserv.cpp @@ -252,7 +252,7 @@ class OperServCore : public Module void OnReload(Configuration::Conf *conf) override { - const Anope::string &osnick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &osnick = conf->GetModule(this)->Get<Anope::string>("client"); if (osnick.empty()) throw ConfigException(this->name + ": <client> must be defined"); diff --git a/modules/webcpanel/webcpanel.cpp b/modules/webcpanel/webcpanel.cpp index 16485f1f6..324759f84 100644 --- a/modules/webcpanel/webcpanel.cpp +++ b/modules/webcpanel/webcpanel.cpp @@ -73,10 +73,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<Anope::string>("server", "httpd/main"); + template_name = block->Get<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<Anope::string>("title", "Anope IRC Services"); provider = ServiceReference<HTTPProvider>("HTTPProvider", provider_name); if (!provider) diff --git a/src/config.cpp b/src/config.cpp index 2bdb71f5e..6ac777a98 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -86,12 +86,12 @@ template<> const Anope::string Block::Get(const Anope::string &tag, const Anope: 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<Anope::string>(tag, def)); } 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<Anope::string>(tag, def); return !str.empty() && !str.equals_ci("no") && !str.equals_ci("off") && !str.equals_ci("false") && !str.equals_ci("0"); } @@ -124,8 +124,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<Anope::string>("type"), + &file = include->Get<Anope::string>("name"); File f(file, type == "executable"); this->LoadConf(f); @@ -154,17 +154,17 @@ 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) != Config->GetBlock(noreload[i].block)->Get<const Anope::string>(noreload[i].name)) + if (this->GetBlock(noreload[i].block)->Get<Anope::string>(noreload[i].name) != Config->GetBlock(noreload[i].block)->Get<Anope::string>(noreload[i].name)) throw ConfigException("<" + noreload[i].block + ":" + noreload[i].name + "> can not be modified once set"); } Block *serverinfo = this->GetBlock("serverinfo"), *options = this->GetBlock("options"), *mail = this->GetBlock("mail"), *networkinfo = this->GetBlock("networkinfo"); - ValidateNotEmpty("serverinfo", "name", serverinfo->Get<const Anope::string>("name")); - ValidateNotEmpty("serverinfo", "description", serverinfo->Get<const Anope::string>("description")); - ValidateNotEmpty("serverinfo", "pid", serverinfo->Get<const Anope::string>("pid")); - ValidateNotEmpty("serverinfo", "motd", serverinfo->Get<const Anope::string>("motd")); + ValidateNotEmpty("serverinfo", "name", serverinfo->Get<Anope::string>("name")); + ValidateNotEmpty("serverinfo", "description", serverinfo->Get<Anope::string>("description")); + ValidateNotEmpty("serverinfo", "pid", serverinfo->Get<Anope::string>("pid")); + ValidateNotEmpty("serverinfo", "motd", serverinfo->Get<Anope::string>("motd")); ValidateNotZero("options", "readtimeout", options->Get<time_t>("readtimeout")); ValidateNotZero("options", "warningtimeout", options->Get<time_t>("warningtimeout")); @@ -174,13 +174,13 @@ Conf::Conf() : Block("") ValidateNotZero("networkinfo", "hostlen", networkinfo->Get<unsigned>("hostlen")); ValidateNotZero("networkinfo", "chanlen", networkinfo->Get<unsigned>("chanlen")); - spacesepstream(options->Get<const Anope::string>("ulineservers")).GetTokens(this->Ulines); + spacesepstream(options->Get<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<Anope::string>(check[i])); } this->ReadTimeout = options->Get<time_t>("readtimeout"); @@ -189,20 +189,20 @@ Conf::Conf() : Block("") this->StrictPrivmsg = !UseStrictPrivmsg ? "/msg " : "/"; { std::vector<Anope::string> defaults; - spacesepstream(this->GetModule("nickserv")->Get<const Anope::string>("defaults")).GetTokens(defaults); + spacesepstream(this->GetModule("nickserv")->Get<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<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<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<Anope::string>("password"); ValidateNotEmpty("uplink", "host", host); ValidateNotZero("uplink", "port", port); @@ -215,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<Anope::string>("name"); ValidateNotEmpty("module", "name", modname); @@ -226,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<Anope::string>("name"), + &modes = opertype->Get<Anope::string>("modes"), + &inherits = opertype->Get<Anope::string>("inherits"), + &commands = opertype->Get<Anope::string>("commands"), + &privs = opertype->Get<Anope::string>("privs"); ValidateNotEmpty("opertype", "name", oname); @@ -271,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<Anope::string>("name"), + &type = oper->Get<Anope::string>("type"), + &password = oper->Get<Anope::string>("password"), + &certfp = oper->Get<Anope::string>("certfp"), + &host = oper->Get<Anope::string>("host"), + &vhost = oper->Get<Anope::string>("vhost"); bool require_oper = oper->Get<bool>("require_oper"); ValidateNotEmpty("oper", "name", nname); @@ -313,12 +313,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<Anope::string>("nick"), + &user = service->Get<Anope::string>("user"), + &host = service->Get<Anope::string>("host"), + &gecos = service->Get<Anope::string>("gecos"), + &modes = service->Get<Anope::string>("modes"), + &channels = service->Get<Anope::string>("channels"); ValidateNotEmpty("service", "nick", nick); ValidateNotEmpty("service", "user", user); @@ -405,16 +405,16 @@ Conf::Conf() : Block("") LogInfo l(logage, rawio, debug); - l.bot = ServiceBot::Find(log->Get<const Anope::string>("bot", "Global"), true); - 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>("other")).GetTokens(l.normal); + l.bot = ServiceBot::Find(log->Get<Anope::string>("bot", "Global"), true); + spacesepstream(log->Get<Anope::string>("target")).GetTokens(l.targets); + spacesepstream(log->Get<Anope::string>("source")).GetTokens(l.sources); + spacesepstream(log->Get<Anope::string>("admin")).GetTokens(l.admin); + spacesepstream(log->Get<Anope::string>("override")).GetTokens(l.override); + spacesepstream(log->Get<Anope::string>("commands")).GetTokens(l.commands); + spacesepstream(log->Get<Anope::string>("servers")).GetTokens(l.servers); + spacesepstream(log->Get<Anope::string>("channels")).GetTokens(l.channels); + spacesepstream(log->Get<Anope::string>("users")).GetTokens(l.users); + spacesepstream(log->Get<Anope::string>("other")).GetTokens(l.normal); this->LogInfos.push_back(l); } @@ -432,11 +432,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<Anope::string>("service"), + &nname = command->Get<Anope::string>("name"), + &cmd = command->Get<Anope::string>("command"), + &permission = command->Get<Anope::string>("permission"), + &group = command->Get<Anope::string>("group"); bool hide = command->Get<bool>("hide"); ValidateNotEmpty("command", "service", service); @@ -456,10 +456,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<Anope::string>("name"), + &service = fantasy->Get<Anope::string>("command"), + &permission = fantasy->Get<Anope::string>("permission"), + &group = fantasy->Get<Anope::string>("group"); bool hide = fantasy->Get<bool>("hide"), prepend_channel = fantasy->Get<bool>("prepend_channel", "yes"); @@ -479,8 +479,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<Anope::string>("name"), + &description = command_group->Get<Anope::string>("description"); CommandGroup gr; gr.name = nname; @@ -508,19 +508,19 @@ Conf::Conf() : Block("") Log() << "Tied oper " << na->GetAccount()->GetDisplay() << " to type " << o->GetType()->GetName(); } - if (options->Get<const Anope::string>("casemap", "ascii") == "ascii") + if (options->Get<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<Anope::string>("casemap") == "rfc1459") Anope::casemap = std::locale(std::locale(), new Anope::rfc1459_ctype<char>()); else { try { - Anope::casemap = std::locale(options->Get<const Anope::string>("casemap").c_str()); + Anope::casemap = std::locale(options->Get<Anope::string>("casemap").c_str()); } catch (const std::runtime_error &) { - Log() << "Unknown casemap " << options->Get<const Anope::string>("casemap") << " - casemap not changed"; + Log() << "Unknown casemap " << options->Get<Anope::string>("casemap") << " - casemap not changed"; } } Anope::CaseMapRebuild(); @@ -611,7 +611,7 @@ Block *Conf::GetModule(const Anope::string &mname) { Block *b = &iters.first->second; - if (b->Get<const Anope::string>("name") == mname) + if (b->Get<Anope::string>("name") == mname) { block = b; break; @@ -628,7 +628,7 @@ ServiceBot *Conf::GetClient(const Anope::string &cname) return ServiceBot::Find(!it->second.empty() ? it->second : cname, true); Block *block = GetModule(cname.lower()); - const Anope::string &client = block->Get<const Anope::string>("client"); + const Anope::string &client = block->Get<Anope::string>("client"); bots[cname] = client; return GetClient(cname); } @@ -890,10 +890,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<Anope::string>("name"); if (dname == wordbuffer && define != b) - wordbuffer = define->Get<const Anope::string>("value"); + wordbuffer = define->Get<Anope::string>("value"); } if (b) diff --git a/src/init.cpp b/src/init.cpp index 305f7d584..853cf7209 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -206,14 +206,14 @@ static void InitSignals() static void remove_pidfile() { - remove(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid").c_str()); + remove(Config->GetBlock("serverinfo")->Get<Anope::string>("pid").c_str()); } /* Create our PID file and write the PID to it. */ static void write_pidfile() { - FILE *pidfile = fopen(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid").c_str(), "w"); + FILE *pidfile = fopen(Config->GetBlock("serverinfo")->Get<Anope::string>("pid").c_str(), "w"); if (pidfile) { #ifdef _WIN32 @@ -225,7 +225,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<Anope::string>("pid")); } static void setuidgid() @@ -235,21 +235,21 @@ static void setuidgid() uid_t uid = -1; gid_t gid = -1; - if (!options->Get<const Anope::string>("user").empty()) + if (!options->Get<Anope::string>("user").empty()) { errno = 0; - struct passwd *u = getpwnam(options->Get<const Anope::string>("user").c_str()); + struct passwd *u = getpwnam(options->Get<Anope::string>("user").c_str()); if (u == NULL) - Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError(); + Log() << "Unable to setuid to " << options->Get<Anope::string>("user") << ": " << Anope::LastError(); else uid = u->pw_uid; } - if (!options->Get<const Anope::string>("group").empty()) + if (!options->Get<Anope::string>("group").empty()) { errno = 0; - struct group *g = getgrnam(options->Get<const Anope::string>("group").c_str()); + struct group *g = getgrnam(options->Get<Anope::string>("group").c_str()); if (g == NULL) - Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError(); + Log() << "Unable to setgid to " << options->Get<Anope::string>("group") << ": " << Anope::LastError(); else gid = g->gr_gid; } @@ -269,16 +269,16 @@ static void setuidgid() if (static_cast<int>(gid) != -1) { if (setgid(gid) == -1) - Log() << "Unable to setgid to " << options->Get<const Anope::string>("group") << ": " << Anope::LastError(); + Log() << "Unable to setgid to " << options->Get<Anope::string>("group") << ": " << Anope::LastError(); else - Log() << "Successfully set group to " << options->Get<const Anope::string>("group"); + Log() << "Successfully set group to " << options->Get<Anope::string>("group"); } if (static_cast<int>(uid) != -1) { if (setuid(uid) == -1) - Log() << "Unable to setuid to " << options->Get<const Anope::string>("user") << ": " << Anope::LastError(); + Log() << "Unable to setuid to " << options->Get<Anope::string>("user") << ": " << Anope::LastError(); else - Log() << "Successfully set user to " << options->Get<const Anope::string>("user"); + Log() << "Successfully set user to " << options->Get<Anope::string>("user"); } #endif } @@ -495,7 +495,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<Anope::string>("name"), 0, block->Get<Anope::string>("description"), block->Get<Anope::string>("id")); for (std::pair<Anope::string, User *> p : UserListByNick) { User *u = p.second; @@ -522,7 +522,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<Anope::string>("name"), NULL); setuidgid(); diff --git a/src/language.cpp b/src/language.cpp index b1b0d77fc..d73074df4 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -38,7 +38,7 @@ void Language::InitLanguages() setlocale(LC_ALL, ""); - spacesepstream sep(Config->GetBlock("options")->Get<const Anope::string>("languages")); + spacesepstream sep(Config->GetBlock("options")->Get<Anope::string>("languages")); Anope::string language; while (sep.GetToken(language)) { diff --git a/src/mail.cpp b/src/mail.cpp index 1812156e9..ea5989299 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -17,7 +17,7 @@ #include "protocol.h" #include "modules/nickserv.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<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) { } @@ -63,19 +63,19 @@ bool Mail::Send(User *u, NickServ::Account *nc, ServiceBot *service, const Anope if (!u) { - if (!b->Get<bool>("usemail") || b->Get<const Anope::string>("sendfrom").empty()) + if (!b->Get<bool>("usemail") || b->Get<Anope::string>("sendfrom").empty()) return false; else if (nc->GetEmail().empty()) return false; nc->lastmail = Anope::CurTime; - Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->GetDisplay(), nc->GetEmail(), subject, message); + Thread *t = new Mail::Message(b->Get<Anope::string>("sendfrom"), nc->GetDisplay(), nc->GetEmail(), 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<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)); @@ -84,7 +84,7 @@ bool Mail::Send(User *u, NickServ::Account *nc, ServiceBot *service, const Anope else { u->lastmail = nc->lastmail = Anope::CurTime; - Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->GetDisplay(), nc->GetEmail(), subject, message); + Thread *t = new Mail::Message(b->Get<Anope::string>("sendfrom"), nc->GetDisplay(), nc->GetEmail(), subject, message); t->Start(); return true; } @@ -96,11 +96,11 @@ bool Mail::Send(User *u, NickServ::Account *nc, ServiceBot *service, const Anope bool Mail::Send(NickServ::Account *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->GetEmail().empty() || subject.empty() || message.empty()) + if (!b->Get<bool>("usemail") || b->Get<Anope::string>("sendfrom").empty() || !nc || nc->GetEmail().empty() || subject.empty() || message.empty()) return false; nc->lastmail = Anope::CurTime; - Thread *t = new Mail::Message(b->Get<const Anope::string>("sendfrom"), nc->GetDisplay(), nc->GetEmail(), subject, message); + Thread *t = new Mail::Message(b->Get<Anope::string>("sendfrom"), nc->GetDisplay(), nc->GetEmail(), subject, message); t->Start(); return true; diff --git a/src/messages.cpp b/src/messages.cpp index 9cdab67c1..a19c71332 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -237,7 +237,7 @@ void MOTD::Run(MessageSource &source, const std::vector<Anope::string> ¶ms) if (s != Me) return; - FILE *f = fopen(Config->GetBlock("serverinfo")->Get<const Anope::string>("motd").c_str(), "r"); + FILE *f = fopen(Config->GetBlock("serverinfo")->Get<Anope::string>("motd").c_str(), "r"); if (f) { IRCD->SendNumeric(375, source.GetSource(), ":- %s Message of the Day", s->GetName().c_str()); @@ -475,7 +475,7 @@ void Whois::Run(MessageSource &source, const std::vector<Anope::string> ¶ms) IRCD->SendNumeric(311, source.GetSource(), "%s %s %s * :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->realname.c_str()); if (bi) IRCD->SendNumeric(307, source.GetSource(), "%s :is a registered nick", bi->nick.c_str()); - IRCD->SendNumeric(312, source.GetSource(), "%s %s :%s", u->nick.c_str(), Me->GetName().c_str(), Config->GetBlock("serverinfo")->Get<const Anope::string>("description").c_str()); + IRCD->SendNumeric(312, source.GetSource(), "%s %s :%s", u->nick.c_str(), Me->GetName().c_str(), Config->GetBlock("serverinfo")->Get<Anope::string>("description").c_str()); if (bi) IRCD->SendNumeric(317, source.GetSource(), "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), static_cast<long>(Anope::CurTime - bi->lastmsg), static_cast<long>(bi->signon)); IRCD->SendNumeric(318, source.GetSource(), "%s :End of /WHOIS list.", u->nick.c_str()); diff --git a/src/protocol.cpp b/src/protocol.cpp index 4baa35c80..d0cb5df68 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -78,7 +78,7 @@ Anope::string IRCDProto::SID_Retrieve() if (!IRCD || !IRCD->RequiresID) return ""; - static Anope::string current_sid = Config->GetBlock("serverinfo")->Get<const Anope::string>("id"); + static Anope::string current_sid = Config->GetBlock("serverinfo")->Get<Anope::string>("id"); if (current_sid.empty()) current_sid = "00A"; @@ -403,8 +403,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<Anope::string>("disallow_start_or_end"), + vhostchars = Config->GetBlock("networkinfo")->Get<Anope::string>("vhost_chars"); if (vhostdisablebe.find_first_of(host[0]) != Anope::string::npos) return false; diff --git a/src/uplink.cpp b/src/uplink.cpp index 2235da81e..f886b3f81 100644 --- a/src/uplink.cpp +++ b/src/uplink.cpp @@ -54,8 +54,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<Anope::string>("localhost").empty()) + UplinkSock->Bind(Config->GetBlock("serverinfo")->Get<Anope::string>("localhost")); Event::OnPreServerConnect(&Event::PreServerConnect::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; |