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. --- src/config.cpp | 2 +- src/init.cpp | 6 +++--- src/mail.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/config.cpp b/src/config.cpp index 94dd8d222..1a1c91cc1 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -22,7 +22,7 @@ using Configuration::File; using Configuration::Conf; -using Configuration::Internal::Block; +using Configuration::Block; using Configuration::Uplink; File ServicesConf("anope.conf", false); // Configuration file name diff --git a/src/init.cpp b/src/init.cpp index 757346e0d..75e6a2419 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -249,7 +249,7 @@ static void write_pidfile() static void setuidgid() { #ifndef _WIN32 - Configuration::Block &options = Config->GetBlock("options"); + const auto &options = Config->GetBlock("options"); uid_t uid = -1; gid_t gid = -1; @@ -500,7 +500,7 @@ bool Anope::Init(int ac, char **av) } /* Create me */ - Configuration::Block &block = Config->GetBlock("serverinfo"); + const auto &block = Config->GetBlock("serverinfo"); Me = new Server(NULL, block.Get("name"), 0, block.Get("description"), block.Get("id")); for (const auto &[_, bi] : *BotListByNick) { @@ -526,7 +526,7 @@ bool Anope::Init(int ac, char **av) if (!getuid() && !getgid()) { /* If we are configured to setuid later, don't issue a warning */ - Configuration::Block &options = Config->GetBlock("options"); + const auto &options = Config->GetBlock("options"); if (options.Get("user").empty()) { std::cerr << "WARNING: You are currently running Anope as the root superuser. Anope does not" << std::endl; diff --git a/src/mail.cpp b/src/mail.cpp index cb2b53bbe..dfa9c19ca 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -74,7 +74,7 @@ bool Mail::Send(User *u, NickCore *nc, BotInfo *service, const Anope::string &su if (!nc || !service || subject.empty() || message.empty()) return false; - Configuration::Block &b = Config->GetBlock("mail"); + const auto &b = Config->GetBlock("mail"); if (!u) { @@ -113,7 +113,7 @@ bool Mail::Send(User *u, NickCore *nc, BotInfo *service, const Anope::string &su bool Mail::Send(NickCore *nc, const Anope::string &subject, const Anope::string &message) { - Configuration::Block &b = Config->GetBlock("mail"); + const auto &b = Config->GetBlock("mail"); if (!b.Get("usemail") || b.Get("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty()) return false; -- cgit