summaryrefslogtreecommitdiff
path: root/modules/operserv/os_shutdown.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-02 14:51:02 +0000
committerSadie Powell <sadie@witchery.services>2025-03-02 15:27:47 +0000
commitf9911dde529adf3dc03f4f14bbd70756ac2f665c (patch)
tree7c720e4f82fdb30b7d8a22fc0809f50bc862fae3 /modules/operserv/os_shutdown.cpp
parenta5e5eb5eb084e8343260ce7bc26ea86798f64fe1 (diff)
Return references instead of pointers from the config system.
We used to return NULL from these methods but now we return an empty block so this can never actually be null now.
Diffstat (limited to 'modules/operserv/os_shutdown.cpp')
-rw-r--r--modules/operserv/os_shutdown.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/operserv/os_shutdown.cpp b/modules/operserv/os_shutdown.cpp
index 5ebdb2200..37dc15747 100644
--- a/modules/operserv/os_shutdown.cpp
+++ b/modules/operserv/os_shutdown.cpp
@@ -18,14 +18,14 @@ public:
CommandOSQuit(Module *creator) : Command(creator, "operserv/quit", 0, 1)
{
this->SetDesc(_("Terminate services WITHOUT saving"));
- if (Config->GetModule(this->owner)->Get<bool>("requirename"))
+ if (Config->GetModule(this->owner).Get<bool>("requirename"))
this->SetSyntax(_("\037network-name\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- const auto requirename = Config->GetModule(this->owner)->Get<bool>("requirename");
- const auto networkname = Config->GetBlock("networkinfo")->Get<Anope::string>("networkname");
+ const auto requirename = Config->GetModule(this->owner).Get<bool>("requirename");
+ const auto networkname = Config->GetBlock("networkinfo").Get<Anope::string>("networkname");
if (requirename && (params.empty() || !params[0].equals_cs(networkname)))
{
OnSyntaxError(source, source.command);
@@ -57,14 +57,14 @@ public:
CommandOSRestart(Module *creator) : Command(creator, "operserv/restart", 0, 1)
{
this->SetDesc(_("Save databases and restart services"));
- if (Config->GetModule(this->owner)->Get<bool>("requirename"))
+ if (Config->GetModule(this->owner).Get<bool>("requirename"))
this->SetSyntax(_("\037network-name\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- const auto requirename = Config->GetModule(this->owner)->Get<bool>("requirename");
- const auto networkname = Config->GetBlock("networkinfo")->Get<Anope::string>("networkname");
+ const auto requirename = Config->GetModule(this->owner).Get<bool>("requirename");
+ const auto networkname = Config->GetBlock("networkinfo").Get<Anope::string>("networkname");
if (requirename && (params.empty() || !params[0].equals_cs(networkname)))
{
OnSyntaxError(source, source.command);
@@ -94,14 +94,14 @@ public:
CommandOSShutdown(Module *creator) : Command(creator, "operserv/shutdown", 0, 1)
{
this->SetDesc(_("Terminate services with save"));
- if (Config->GetModule(this->owner)->Get<bool>("requirename"))
+ if (Config->GetModule(this->owner).Get<bool>("requirename"))
this->SetSyntax(_("\037network-name\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- const auto requirename = Config->GetModule(this->owner)->Get<bool>("requirename");
- const auto networkname = Config->GetBlock("networkinfo")->Get<Anope::string>("networkname");
+ const auto requirename = Config->GetModule(this->owner).Get<bool>("requirename");
+ const auto networkname = Config->GetBlock("networkinfo").Get<Anope::string>("networkname");
if (requirename && (params.empty() || !params[0].equals_cs(networkname)))
{
OnSyntaxError(source, source.command);