summaryrefslogtreecommitdiff
path: root/modules/chanserv/cs_mode.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/chanserv/cs_mode.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/chanserv/cs_mode.cpp')
-rw-r--r--modules/chanserv/cs_mode.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/chanserv/cs_mode.cpp b/modules/chanserv/cs_mode.cpp
index 47e2b84ad..cc7a526cd 100644
--- a/modules/chanserv/cs_mode.cpp
+++ b/modules/chanserv/cs_mode.cpp
@@ -336,7 +336,7 @@ class CommandCSMode final
continue;
}
- if (modelocks->GetMLock().size() >= Config->GetModule(this->owner)->Get<unsigned>("max", "50"))
+ if (modelocks->GetMLock().size() >= Config->GetModule(this->owner).Get<unsigned>("max", "50"))
{
source.Reply(_("The mode lock list of \002%s\002 is full."), ci->name.c_str());
continue;
@@ -946,22 +946,22 @@ public:
}
- void OnReload(Configuration::Conf *conf) override
+ void OnReload(Configuration::Conf &conf) override
{
modes.clear();
- for (int i = 0; i < conf->CountBlock("command"); ++i)
+ for (int i = 0; i < conf.CountBlock("command"); ++i)
{
- Configuration::Block *block = conf->GetBlock("command", i);
+ 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<const Anope::string>("name"),
+ &cmd = block.Get<const 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<const Anope::string>("set"),
+ &unset = block.Get<const Anope::string>("unset");
if (set.empty() && unset.empty())
continue;
@@ -1024,7 +1024,7 @@ public:
{
ModeLocks *ml = modelocks.Require(ci);
Anope::string mlock;
- spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("mlock", "+nt"));
+ spacesepstream sep(Config->GetModule(this).Get<const Anope::string>("mlock", "+nt"));
if (sep.GetToken(mlock))
{
bool add = true;