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 |
