diff options
author | Adam <Adam@anope.org> | 2016-10-09 22:05:13 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-10-09 22:05:13 -0400 |
commit | 83b8e655306fd88fa130aea84f91d017edbedc24 (patch) | |
tree | e867e5d8aa0eaf62d89468cc3451aecffddcb87e | |
parent | 70c4659fe5fa7e63352a6c7a1e7a048c4353a33b (diff) |
Adjust reading operserv core config opts
-rw-r--r-- | modules/operserv/akill.cpp | 12 | ||||
-rw-r--r-- | modules/operserv/chankill.cpp | 4 | ||||
-rw-r--r-- | modules/operserv/kill.cpp | 2 | ||||
-rw-r--r-- | modules/operserv/stats.cpp | 6 | ||||
-rw-r--r-- | modules/operserv/sxline.cpp | 22 |
5 files changed, 23 insertions, 23 deletions
diff --git a/modules/operserv/akill.cpp b/modules/operserv/akill.cpp index 36d555b79..4da93ca05 100644 --- a/modules/operserv/akill.cpp +++ b/modules/operserv/akill.cpp @@ -42,7 +42,7 @@ class CommandOSAKill : public Command sep.GetToken(mask); } - time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv")->Get<time_t>("autokillexpiry", "30d"); + time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv/main")->Get<time_t>("autokillexpiry", "30d"); /* If the expiry given does not contain a final letter, it's in days, * said the doc. Ah well. */ @@ -109,7 +109,7 @@ class CommandOSAKill : public Command if (targ) mask = "*@" + targ->host; - if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty()) + if (Config->GetModule("operserv/main")->Get<bool>("addakiller", "yes") && !source.GetNick().empty()) reason = "[" + source.GetNick() + "] " + reason; if (mask.find_first_not_of("/~@.*?") == Anope::string::npos) @@ -133,7 +133,7 @@ class CommandOSAKill : public Command x->SetExpires(expires); x->SetReason(reason); - if (Config->GetModule("operserv")->Get<bool>("akillids")) + if (Config->GetModule("operserv/main")->Get<bool>("akillids")) x->SetID(XLineManager::GenerateUID()); unsigned int affected = 0; @@ -159,7 +159,7 @@ class CommandOSAKill : public Command } akills->AddXLine(x); - if (Config->GetModule("operserv")->Get<bool>("akillonadd")) + if (Config->GetModule("operserv/main")->Get<bool>("akillonadd")) akills->Send(NULL, x); source.Reply(_("\002{0}\002 added to the akill list."), mask); @@ -325,7 +325,7 @@ class CommandOSAKill : public Command ListFormatter list(source.GetAccount()); list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Expires")); - if (Config->GetModule("operserv")->Get<bool>("akillids")) + if (Config->GetModule("operserv/main")->Get<bool>("akillids")) list.AddColumn(_("ID")); list.AddColumn(_("Reason")); @@ -390,7 +390,7 @@ class CommandOSAKill : public Command " If a unit specifier is not included, the default is days, so \037+30\037 means 30 days." " To add an auto kill which does not expire, use \037+0\037. " " The default auto kill expiry time is \002{1}\002"), - source.command, Anope::Duration(Config->GetModule("operserv")->Get<time_t>("autokillexpiry", "30d"), source.GetAccount())); + source.command, Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("autokillexpiry", "30d"), source.GetAccount())); const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) diff --git a/modules/operserv/chankill.cpp b/modules/operserv/chankill.cpp index 9ab820821..674200c84 100644 --- a/modules/operserv/chankill.cpp +++ b/modules/operserv/chankill.cpp @@ -48,7 +48,7 @@ class CommandOSChanKill : public Command last_param = 2; } - time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv")->Get<time_t>("autokillexpiry", "30d"); + time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv/main")->Get<time_t>("autokillexpiry", "30d"); if (!expiry.empty() && isdigit(expiry[expiry.length() - 1])) expires *= 86400; @@ -74,7 +74,7 @@ class CommandOSChanKill : public Command reason += params[last_param + 1]; Anope::string realreason; - if (Config->GetModule("operserv")->Get<bool>("addakiller") && !source.GetNick().empty()) + if (Config->GetModule("operserv/main")->Get<bool>("addakiller") && !source.GetNick().empty()) realreason = "[" + source.GetNick() + "] " + reason; else realreason = reason; diff --git a/modules/operserv/kill.cpp b/modules/operserv/kill.cpp index b2745272e..224cf7bfd 100644 --- a/modules/operserv/kill.cpp +++ b/modules/operserv/kill.cpp @@ -42,7 +42,7 @@ class CommandOSKill : public Command { if (reason.empty()) reason = "No reason specified"; - if (Config->GetModule("operserv")->Get<bool>("addakiller")) + if (Config->GetModule("operserv/main")->Get<bool>("addakiller")) reason = "(" + source.GetNick() + ") " + reason; Log(LOG_ADMIN, source, this) << "on " << u2->nick << " for " << reason; u2->Kill(*source.service, reason); diff --git a/modules/operserv/stats.cpp b/modules/operserv/stats.cpp index 8476e616e..04b1af6c8 100644 --- a/modules/operserv/stats.cpp +++ b/modules/operserv/stats.cpp @@ -104,7 +104,7 @@ class CommandOSStats : public Command { /* AKILLs */ source.Reply(_("Current number of AKILLs: \002{0}\002"), akills->GetCount()); - timeout = Config->GetModule("operserv")->Get<time_t>("autokillexpiry", "30d") + 59; + timeout = Config->GetModule("operserv/main")->Get<time_t>("autokillexpiry", "30d") + 59; if (timeout >= 172800) source.Reply(_("Default AKILL expiry time: \002{0} days\002"), timeout / 86400); else if (timeout >= 86400) @@ -124,7 +124,7 @@ class CommandOSStats : public Command { /* SNLINEs */ source.Reply(_("Current number of SNLINEs: \002{0}\002"), snlines->GetCount()); - timeout = Config->GetModule("operserv")->Get<time_t>("snlineexpiry", "30d") + 59; + timeout = Config->GetModule("operserv/main")->Get<time_t>("snlineexpiry", "30d") + 59; if (timeout >= 172800) source.Reply(_("Default SNLINE expiry time: \002{0} days\002"), timeout / 86400); else if (timeout >= 86400) @@ -144,7 +144,7 @@ class CommandOSStats : public Command { /* SQLINEs */ source.Reply(_("Current number of SQLINEs: \002{0}\002"), sqlines->GetCount()); - timeout = Config->GetModule("operserv")->Get<time_t>("sglineexpiry", "30d") + 59; + timeout = Config->GetModule("operserv/main")->Get<time_t>("sglineexpiry", "30d") + 59; if (timeout >= 172800) source.Reply(_("Default SQLINE expiry time: \002{0} days\002"), timeout / 86400); else if (timeout >= 86400) diff --git a/modules/operserv/sxline.cpp b/modules/operserv/sxline.cpp index 748418790..cc6b9669c 100644 --- a/modules/operserv/sxline.cpp +++ b/modules/operserv/sxline.cpp @@ -168,7 +168,7 @@ class CommandOSSXLineBase : public Command { ListFormatter list(source.GetAccount()); list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("By")).AddColumn(_("Created")).AddColumn(_("Expires")); - if (Config->GetModule("operserv")->Get<bool>("akillids")) + if (Config->GetModule("operserv/main")->Get<bool>("akillids")) list.AddColumn(_("ID")); list.AddColumn(_("Reason")); @@ -241,7 +241,7 @@ class CommandOSSNLine : public CommandOSSXLineBase last_param = 3; } - time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv")->Get<time_t>("snlineexpiry", "30d"); + time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv/main")->Get<time_t>("snlineexpiry", "30d"); /* If the expiry given does not contain a final letter, it's in days, * said the doc. Ah well. */ @@ -310,7 +310,7 @@ class CommandOSSNLine : public CommandOSSXLineBase if (mask[masklen - 1] == ' ') mask.erase(masklen - 1); - if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty()) + if (Config->GetModule("operserv/main")->Get<bool>("addakiller", "yes") && !source.GetNick().empty()) reason = "[" + source.GetNick() + "] " + reason; if (mask.find_first_not_of("/.*?") == Anope::string::npos) @@ -328,7 +328,7 @@ class CommandOSSNLine : public CommandOSSXLineBase x->SetExpires(expires); x->SetReason(reason); - if (Config->GetModule("operserv")->Get<bool>("akillids")) + if (Config->GetModule("operserv/main")->Get<bool>("akillids")) x->SetID(XLineManager::GenerateUID()); unsigned int affected = 0; @@ -355,7 +355,7 @@ class CommandOSSNLine : public CommandOSSXLineBase this->xlm()->AddXLine(x); - if (Config->GetModule("operserv")->Get<bool>("killonsnline", "yes")) + if (Config->GetModule("operserv/main")->Get<bool>("killonsnline", "yes")) { Anope::string rreason = "G-Lined: " + reason; @@ -398,7 +398,7 @@ class CommandOSSNLine : public CommandOSSXLineBase " To add a {0} which does not expire, use \037+0\037." " The default {0} expiry time is \002{1}\002." " 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())); + source.command, Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("snlineexpiry", "30d"), source.GetAccount())); const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) @@ -471,7 +471,7 @@ class CommandOSSQLine : public CommandOSSXLineBase last_param = 3; } - time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv")->Get<time_t>("sqlineexpiry", "30d"); + time_t expires = !expiry.empty() ? Anope::DoTime(expiry) : Config->GetModule("operserv/main")->Get<time_t>("sqlineexpiry", "30d"); /* If the expiry given does not contain a final letter, it's in days, * said the doc. Ah well. */ @@ -522,7 +522,7 @@ class CommandOSSQLine : public CommandOSSXLineBase } } - if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty()) + if (Config->GetModule("operserv/main")->Get<bool>("addakiller", "yes") && !source.GetNick().empty()) reason = "[" + source.GetNick() + "] " + reason; if (mask.find_first_not_of("./?*") == Anope::string::npos) @@ -540,7 +540,7 @@ class CommandOSSQLine : public CommandOSSXLineBase x->SetExpires(expires); x->SetReason(reason); - if (Config->GetModule("operserv")->Get<bool>("akillids")) + if (Config->GetModule("operserv/main")->Get<bool>("akillids")) x->SetID(XLineManager::GenerateUID()); unsigned int affected = 0; @@ -567,7 +567,7 @@ class CommandOSSQLine : public CommandOSSXLineBase this->xlm()->AddXLine(x); - if (Config->GetModule("operserv")->Get<bool>("killonsqline", "yes")) + if (Config->GetModule("operserv/main")->Get<bool>("killonsqline", "yes")) { Anope::string rreason = "Q-Lined: " + reason; @@ -635,7 +635,7 @@ class CommandOSSQLine : public CommandOSSXLineBase " If a unit specifier is not included, the default is days, so \037+30\037 by itself means 30 days." " To add a {0} which does not expire, use \037+0\037." " The default {0} expiry time is \002{1}\002."), - source.command, Anope::Duration(Config->GetModule("operserv")->Get<time_t>("sqlineexpiry", "30d"), source.GetAccount())); + source.command, Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("sqlineexpiry", "30d"), source.GetAccount())); const Anope::string ®exengine = Config->GetBlock("options")->Get<Anope::string>("regexengine"); if (!regexengine.empty()) |