diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-02 14:51:02 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-02 15:27:47 +0000 |
commit | f9911dde529adf3dc03f4f14bbd70756ac2f665c (patch) | |
tree | 7c720e4f82fdb30b7d8a22fc0809f50bc862fae3 /modules/chanserv/cs_flags.cpp | |
parent | a5e5eb5eb084e8343260ce7bc26ea86798f64fe1 (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_flags.cpp')
-rw-r--r-- | modules/chanserv/cs_flags.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/chanserv/cs_flags.cpp b/modules/chanserv/cs_flags.cpp index 691319634..876eb67e4 100644 --- a/modules/chanserv/cs_flags.cpp +++ b/modules/chanserv/cs_flags.cpp @@ -93,7 +93,7 @@ class CommandCSFlags final if (IRCD->IsChannelValid(mask)) { - if (Config->GetModule("chanserv")->Get<bool>("disallow_channel_access")) + if (Config->GetModule("chanserv").Get<bool>("disallow_channel_access")) { source.Reply(_("Channels may not be on access lists.")); return; @@ -116,7 +116,7 @@ class CommandCSFlags final else { na = NickAlias::Find(mask); - if (!na && Config->GetModule("chanserv")->Get<bool>("disallow_hostmask_access")) + if (!na && Config->GetModule("chanserv").Get<bool>("disallow_hostmask_access")) { source.Reply(_("Masks and unregistered users may not be on access lists.")); return; @@ -179,7 +179,7 @@ class CommandCSFlags final } } - unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1000"); + unsigned access_max = Config->GetModule("chanserv").Get<unsigned>("accessmax", "1000"); if (access_max && ci->GetDeepAccessCount() >= access_max) { source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max); @@ -494,21 +494,21 @@ public: } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { defaultFlags.clear(); - for (int i = 0; i < conf->CountBlock("privilege"); ++i) + for (int i = 0; i < conf.CountBlock("privilege"); ++i) { - Configuration::Block *priv = conf->GetBlock("privilege", i); + Configuration::Block &priv = conf.GetBlock("privilege", i); - const Anope::string &pname = priv->Get<const Anope::string>("name"); + const Anope::string &pname = priv.Get<const Anope::string>("name"); Privilege *p = PrivilegeManager::FindPrivilege(pname); if (p == NULL) continue; - const Anope::string &value = priv->Get<const Anope::string>("flag"); + const Anope::string &value = priv.Get<const Anope::string>("flag"); if (value.empty()) continue; |