1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 12:43:13 +02:00

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.
This commit is contained in:
Sadie Powell
2025-04-19 12:47:52 +01:00
parent 452e62c050
commit d815906393
42 changed files with 61 additions and 67 deletions
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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<const Anope::string>("name"), 0, block.Get<const Anope::string>("description"), block.Get<const Anope::string>("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<const Anope::string>("user").empty())
{
std::cerr << "WARNING: You are currently running Anope as the root superuser. Anope does not" << std::endl;
+2 -2
View File
@@ -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<bool>("usemail") || b.Get<const Anope::string>("sendfrom").empty() || !nc || nc->email.empty() || subject.empty() || message.empty())
return false;