From d81590639331f9b233d3e16512aeb01f5c024a16 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 19 Apr 2025 12:47:52 +0100 Subject: Get rid of the internal block wrapper. This only existed for compatibility with old 2.0 modules and 2.1 has already broken compatibility with them. --- modules/chanserv/cs_access.cpp | 2 +- modules/chanserv/cs_ban.cpp | 2 +- modules/chanserv/cs_flags.cpp | 2 +- modules/chanserv/cs_log.cpp | 4 ++-- modules/chanserv/cs_mode.cpp | 2 +- modules/chanserv/cs_set_misc.cpp | 2 +- modules/chanserv/cs_xop.cpp | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/chanserv') diff --git a/modules/chanserv/cs_access.cpp b/modules/chanserv/cs_access.cpp index d3ca6e492..c7754b2ad 100644 --- a/modules/chanserv/cs_access.cpp +++ b/modules/chanserv/cs_access.cpp @@ -900,7 +900,7 @@ public: for (int i = 0; i < conf.CountBlock("privilege"); ++i) { - Configuration::Block &priv = conf.GetBlock("privilege", i); + const auto &priv = conf.GetBlock("privilege", i); const Anope::string &pname = priv.Get("name"); diff --git a/modules/chanserv/cs_ban.cpp b/modules/chanserv/cs_ban.cpp index dca9e8bbf..2696a1978 100644 --- a/modules/chanserv/cs_ban.cpp +++ b/modules/chanserv/cs_ban.cpp @@ -50,7 +50,7 @@ public: void Execute(CommandSource &source, const std::vector ¶ms) override { - Configuration::Block &block = Config->GetCommand(source); + const auto &block = Config->GetCommand(source); const Anope::string &mode = block.Get("mode", "BAN"); ChannelMode *cm = ModeManager::FindChannelModeByName(mode); if (cm == NULL) diff --git a/modules/chanserv/cs_flags.cpp b/modules/chanserv/cs_flags.cpp index 708978191..e0de2c81e 100644 --- a/modules/chanserv/cs_flags.cpp +++ b/modules/chanserv/cs_flags.cpp @@ -503,7 +503,7 @@ public: for (int i = 0; i < conf.CountBlock("privilege"); ++i) { - Configuration::Block &priv = conf.GetBlock("privilege", i); + const auto &priv = conf.GetBlock("privilege", i); const Anope::string &pname = priv.Get("name"); diff --git a/modules/chanserv/cs_log.cpp b/modules/chanserv/cs_log.cpp index de3bbed2b..f50cbf517 100644 --- a/modules/chanserv/cs_log.cpp +++ b/modules/chanserv/cs_log.cpp @@ -325,12 +325,12 @@ public: void OnReload(Configuration::Conf &conf) override { - Configuration::Block &block = conf.GetModule(this); + const auto &block = conf.GetModule(this); defaults.clear(); for (int i = 0; i < block.CountBlock("default"); ++i) { - Configuration::Block &def = block.GetBlock("default", i); + const auto &def = block.GetBlock("default", i); LogDefault ld; diff --git a/modules/chanserv/cs_mode.cpp b/modules/chanserv/cs_mode.cpp index 85ebaf5ce..eebc830c6 100644 --- a/modules/chanserv/cs_mode.cpp +++ b/modules/chanserv/cs_mode.cpp @@ -969,7 +969,7 @@ public: for (int i = 0; i < conf.CountBlock("command"); ++i) { - Configuration::Block &block = conf.GetBlock("command", i); + const auto &block = conf.GetBlock("command", i); const Anope::string &cname = block.Get("name"), &cmd = block.Get("command"); diff --git a/modules/chanserv/cs_set_misc.cpp b/modules/chanserv/cs_set_misc.cpp index 58650f557..f41eb3301 100644 --- a/modules/chanserv/cs_set_misc.cpp +++ b/modules/chanserv/cs_set_misc.cpp @@ -205,7 +205,7 @@ public: for (int i = 0; i < conf.CountBlock("command"); ++i) { - Configuration::Block &block = conf.GetBlock("command", i); + const auto &block = conf.GetBlock("command", i); if (block.Get("command") != "chanserv/set/misc") continue; diff --git a/modules/chanserv/cs_xop.cpp b/modules/chanserv/cs_xop.cpp index f808c7622..ffdf46488 100644 --- a/modules/chanserv/cs_xop.cpp +++ b/modules/chanserv/cs_xop.cpp @@ -640,7 +640,7 @@ public: for (int i = 0; i < conf.CountBlock("privilege"); ++i) { - Configuration::Block &block = conf.GetBlock("privilege", i); + const auto &block = conf.GetBlock("privilege", i); const Anope::string &pname = block.Get("name"); Privilege *p = PrivilegeManager::FindPrivilege(pname); @@ -656,7 +656,7 @@ public: for (int i = 0; i < conf.CountBlock("command"); ++i) { - Configuration::Block &block = conf.GetBlock("command", i); + const auto &block = conf.GetBlock("command", i); const Anope::string &cname = block.Get("name"), &cserv = block.Get("command"); if (cname.empty() || cserv != "chanserv/xop") -- cgit