From b456adc15562f7e41c85fea84528cc0879233ee6 Mon Sep 17 00:00:00 2001 From: Daniel Vassdal Date: Mon, 30 Nov 2020 21:12:52 +0100 Subject: Fix issue where m_pbkdf2 was not aware of services loaded before it --- src/modules/m_pbkdf2.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modules') diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index 90fa54a77..077390741 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -209,6 +209,14 @@ class ModulePBKDF2 : public Module stdalgo::delete_all(providers); } + void init() CXX11_OVERRIDE + { + // Let ourself know about any existing services. + const ModuleManager::DataProviderMap& dataproviders = ServerInstance->Modules->DataProviders; + for (ModuleManager::DataProviderMap::const_iterator it = dataproviders.begin(); it != dataproviders.end(); ++it) + OnServiceAdd(*it->second); + } + void OnServiceAdd(ServiceProvider& provider) CXX11_OVERRIDE { // Check if it's a hash provider -- cgit v1.3.1-10-gc9f91 From 66dbd438f23a6beb06b0d44b9121deeb1e3f73bc Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 16 Dec 2020 03:46:36 +0000 Subject: Use !empty instead of size when checking if containers are empty. --- src/configreader.cpp | 2 +- src/cull_list.cpp | 2 +- src/modules/m_sasl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/configreader.cpp b/src/configreader.cpp index d06753423..b258d93fc 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -524,7 +524,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) // On first run, ports are bound later on FailedPortList pl; ServerInstance->BindPorts(pl); - if (pl.size()) + if (!pl.empty()) { std::cout << "Warning! Some of your listener" << (pl.size() == 1 ? "s" : "") << " failed to bind:" << std::endl; for (FailedPortList::const_iterator iter = pl.begin(); iter != pl.end(); ++iter) diff --git a/src/cull_list.cpp b/src/cull_list.cpp index e05d44918..80d7ddb97 100644 --- a/src/cull_list.cpp +++ b/src/cull_list.cpp @@ -73,7 +73,7 @@ void CullList::Apply() classbase* c = queue[i]; delete c; } - if (list.size()) + if (!list.empty()) { ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "WARNING: Objects added to cull list in a destructor"); Apply(); diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 6aaa83f33..e202bae45 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -213,7 +213,7 @@ class SaslAuthenticator params.push_back(method); const std::string fp = sslapi ? sslapi->GetFingerprint(user) : ""; - if (fp.size()) + if (!fp.empty()) params.push_back(fp); SendSASL(user, "*", 'S', params); -- cgit v1.3.1-10-gc9f91 From ba4a23e248d7d4d54d204bc4b5e20580bfbf7616 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 16 Dec 2020 14:53:12 +0000 Subject: Fix MAP output on a dual v2/v3 network. --- src/modules/m_spanningtree/override_map.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index 26bbcc279..5122fd0ed 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -53,22 +53,26 @@ static inline bool IsHidden(User* user, TreeServer* server) } // Calculate the map depth the servers go, and the longest server name -static void GetDepthAndLen(TreeServer* current, unsigned int depth, unsigned int& max_depth, unsigned int& max_len) +static void GetDepthAndLen(TreeServer* current, unsigned int depth, unsigned int& max_depth, unsigned int& max_len, unsigned int& max_version) { if (depth > max_depth) max_depth = depth; + if (current->GetName().length() > max_len) max_len = current->GetName().length(); + if (current->GetRawVersion().length() > max_version) + max_version = current->GetRawVersion().length(); + const TreeServer::ChildServers& servers = current->GetChildren(); for (TreeServer::ChildServers::const_iterator i = servers.begin(); i != servers.end(); ++i) { TreeServer* child = *i; - GetDepthAndLen(child, depth + 1, max_depth, max_len); + GetDepthAndLen(child, depth + 1, max_depth, max_len, max_version); } } -static std::vector GetMap(User* user, TreeServer* current, unsigned int max_len, unsigned int depth) +static std::vector GetMap(User* user, TreeServer* current, unsigned int max_len, unsigned int max_version_len, unsigned int depth) { float percent = 0; @@ -89,6 +93,8 @@ static std::vector GetMap(User* user, TreeServer* current, unsigned buffer += " " + cur_vers; buffer += ")"; + + buffer.append(max_version_len - current->GetRawVersion().length(), ' '); } // Pad with spaces until its at max len, max_len must always be >= my names length @@ -132,7 +138,7 @@ static std::vector GetMap(User* user, TreeServer* current, unsigned } // Build the map for this child - std::vector child_map = GetMap(user, child, next_len, depth + 1); + std::vector child_map = GetMap(user, child, next_len, max_version_len, depth + 1); for (std::vector::const_iterator j = child_map.begin(); j != child_map.end(); ++j) { @@ -193,7 +199,8 @@ CmdResult CommandMap::Handle(User* user, const Params& parameters) // Max depth and max server name length unsigned int max_depth = 0; unsigned int max_len = 0; - GetDepthAndLen(Utils->TreeRoot, 0, max_depth, max_len); + unsigned int max_version = 0; + GetDepthAndLen(Utils->TreeRoot, 0, max_depth, max_len, max_version); unsigned int max; if (user->IsOper() || !Utils->FlatLinks) @@ -205,9 +212,11 @@ CmdResult CommandMap::Handle(User* user, const Params& parameters) { // This user can't see any depth max = max_len; + if (!user->IsOper()) + max_version = 0; } - std::vector map = GetMap(user, Utils->TreeRoot, max, 0); + std::vector map = GetMap(user, Utils->TreeRoot, max, max_version, 0); for (std::vector::const_iterator i = map.begin(); i != map.end(); ++i) user->WriteRemoteNumeric(RPL_MAP, *i); -- cgit v1.3.1-10-gc9f91 From b618b194f3166a55ca7e7889c7346b65c174d397 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 18 Dec 2020 00:55:22 +0000 Subject: Don't call events provided by dying or dead modules. --- include/event.h | 37 ++++++++++++++++++----------- src/modules/m_spanningtree/misccommands.cpp | 6 +++++ 2 files changed, 29 insertions(+), 14 deletions(-) (limited to 'src/modules') diff --git a/include/event.h b/include/event.h index 9fd43ccd2..7e8e64c7d 100644 --- a/include/event.h +++ b/include/event.h @@ -58,6 +58,9 @@ class Events::ModuleEventProvider : public ServiceProvider, private dynamic_refe prov.SetCaptureHook(this); } + /** Retrieves the module which created this listener. */ + const Module* GetModule() const { return prov.creator; } + /** Get list of objects subscribed to this event * @return List of subscribed objects */ @@ -181,13 +184,16 @@ inline bool Events::ModuleEventProvider::ElementComp::operator()(Events::ModuleE * FOREACH_MOD_CUSTOM(accountevprov, AccountEventListener, OnAccountChange, MOD_RESULT, (user, newaccount)) */ #define FOREACH_MOD_CUSTOM(prov, listenerclass, func, params) do { \ - const ::Events::ModuleEventProvider::SubscriberList& _handlers = (prov).GetSubscribers(); \ - for (::Events::ModuleEventProvider::SubscriberList::const_iterator _i = _handlers.begin(); _i != _handlers.end(); ++_i) \ + if (!(prov).GetModule() || (prov).GetModule()->dying) \ { \ - listenerclass* _t = static_cast(*_i); \ - const Module* _m = _t->GetModule(); \ - if (_m && !_m->dying) \ + const ::Events::ModuleEventProvider::SubscriberList& _handlers = (prov).GetSubscribers(); \ + for (::Events::ModuleEventProvider::SubscriberList::const_iterator _i = _handlers.begin(); _i != _handlers.end(); ++_i) \ + { \ + listenerclass* _t = static_cast(*_i); \ + const Module* _m = _t->GetModule(); \ + if (_m && !_m->dying) \ _t->func params ; \ + } \ } \ } while (0); @@ -200,15 +206,18 @@ inline bool Events::ModuleEventProvider::ElementComp::operator()(Events::ModuleE */ #define FIRST_MOD_RESULT_CUSTOM(prov, listenerclass, func, result, params) do { \ result = MOD_RES_PASSTHRU; \ - const ::Events::ModuleEventProvider::SubscriberList& _handlers = (prov).GetSubscribers(); \ - for (::Events::ModuleEventProvider::SubscriberList::const_iterator _i = _handlers.begin(); _i != _handlers.end(); ++_i) \ + if (!(prov).GetModule() || (prov).GetModule()->dying) \ { \ - listenerclass* _t = static_cast(*_i); \ - const Module* _m = _t->GetModule(); \ - if (!_m || _m->dying) \ - continue; \ - result = _t->func params ; \ - if (result != MOD_RES_PASSTHRU) \ - break; \ + const ::Events::ModuleEventProvider::SubscriberList& _handlers = (prov).GetSubscribers(); \ + for (::Events::ModuleEventProvider::SubscriberList::const_iterator _i = _handlers.begin(); _i != _handlers.end(); ++_i) \ + { \ + listenerclass* _t = static_cast(*_i); \ + const Module* _m = _t->GetModule(); \ + if (!_m || _m->dying) \ + continue; \ + result = _t->func params ; \ + if (result != MOD_RES_PASSTHRU) \ + break; \ + } \ } \ } while (0); diff --git a/src/modules/m_spanningtree/misccommands.cpp b/src/modules/m_spanningtree/misccommands.cpp index c9f86d696..bba05b1fc 100644 --- a/src/modules/m_spanningtree/misccommands.cpp +++ b/src/modules/m_spanningtree/misccommands.cpp @@ -26,12 +26,18 @@ void CmdBuilder::FireEvent(Server* target, const char* cmd, ClientProtocol::TagMap& taglist) { + if (!Utils->Creator || Utils->Creator->dying) + return; + FOREACH_MOD_CUSTOM(Utils->Creator->GetMessageEventProvider(), ServerProtocol::MessageEventListener, OnBuildMessage, (target, cmd, taglist)); UpdateTags(); } void CmdBuilder::FireEvent(User* target, const char* cmd, ClientProtocol::TagMap& taglist) { + if (!Utils->Creator || Utils->Creator->dying) + return; + FOREACH_MOD_CUSTOM(Utils->Creator->GetMessageEventProvider(), ServerProtocol::MessageEventListener, OnBuildMessage, (target, cmd, taglist)); UpdateTags(); } -- cgit v1.3.1-10-gc9f91 From 6cfabb0064cab52bbbab59974e53dc0fa1954da7 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 20 Dec 2020 03:04:21 +0000 Subject: Hide the server name/desc better when is set. --- include/clientprotocolmsg.h | 12 ++++++------ include/configreader.h | 6 ++++++ include/modules/cap.h | 2 +- include/modules/ircv3_replies.h | 12 ++++++------ include/numericbuilder.h | 4 ++-- src/configreader.cpp | 4 ++-- src/coremods/core_info/cmd_admin.cpp | 2 +- src/coremods/core_info/cmd_motd.cpp | 2 +- src/coremods/core_info/cmd_time.cpp | 3 +-- src/coremods/core_info/core_info.cpp | 2 +- src/coremods/core_stub.cpp | 2 +- src/modules/m_ircv3_batch.cpp | 2 +- src/modules/m_permchannels.cpp | 2 +- src/modules/m_spanningtree/main.cpp | 2 +- src/modules/m_sslinfo.cpp | 2 +- src/server.cpp | 2 +- src/usermanager.cpp | 2 +- 17 files changed, 34 insertions(+), 29 deletions(-) (limited to 'src/modules') diff --git a/include/clientprotocolmsg.h b/include/clientprotocolmsg.h index 07f32b686..53122cff9 100644 --- a/include/clientprotocolmsg.h +++ b/include/clientprotocolmsg.h @@ -68,7 +68,7 @@ class ClientProtocol::Messages::Numeric : public ClientProtocol::Message * @param user User to send the numeric to. May be unregistered, must remain valid as long as this object is alive. */ Numeric(const ::Numeric::Numeric& num, User* user) - : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer()->GetName() : ServerInstance->Config->ServerName)) + : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer() : ServerInstance->FakeClient->server)->GetName()) { if (user->registered & REG_NICK) PushParamRef(user->nick); @@ -82,7 +82,7 @@ class ClientProtocol::Messages::Numeric : public ClientProtocol::Message * @param target Target string, must stay valid as long as this object is alive. */ Numeric(const ::Numeric::Numeric& num, const std::string& target) - : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer()->GetName() : ServerInstance->Config->ServerName)) + : ClientProtocol::Message(NULL, (num.GetServer() ? num.GetServer() : ServerInstance->FakeClient->server)->GetName()) { PushParamRef(target); InitFromNumeric(num); @@ -92,7 +92,7 @@ class ClientProtocol::Messages::Numeric : public ClientProtocol::Message * @param num Numeric number. */ Numeric(unsigned int num) - : ClientProtocol::Message(NULL, ServerInstance->Config->ServerName) + : ClientProtocol::Message(NULL, ServerInstance->Config->GetServerName()) { InitCommand(num); PushParam("*"); @@ -643,7 +643,7 @@ struct ClientProtocol::Messages::Ping : public ClientProtocol::Message Ping() : ClientProtocol::Message("PING") { - PushParamRef(ServerInstance->Config->ServerName); + PushParamRef(ServerInstance->Config->GetServerName()); } /** Constructor. @@ -666,9 +666,9 @@ struct ClientProtocol::Messages::Pong : public ClientProtocol::Message * @param server Pinged server. Must remain valid as long as this object is alive if non-empty. */ Pong(const std::string& cookie, const std::string& server = "") - : ClientProtocol::Message("PONG", ServerInstance->Config->ServerName) + : ClientProtocol::Message("PONG", ServerInstance->Config->GetServerName()) { - PushParamRef(ServerInstance->Config->ServerName); + PushParamRef(ServerInstance->Config->GetServerName()); if (!server.empty()) PushParamRef(server); PushParamRef(cookie); diff --git a/include/configreader.h b/include/configreader.h index 7274dfad8..3a5ea9c60 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -451,6 +451,12 @@ class CoreExport ServerConfig */ const std::string& GetSID() const { return sid; } + /** Retrieves the server name which should be shown to users. */ + const std::string& GetServerName() const { return HideServer.empty() ? ServerName : HideServer; } + + /** Retrieves the server description which should be shown to users. */ + const std::string& GetServerDesc() const { return HideServer.empty() ? ServerDesc : HideServer; } + /** Read the entire configuration into memory * and initialize this class. All other methods * should be used only by the core. diff --git a/include/modules/cap.h b/include/modules/cap.h index e14bcc422..9dacdc200 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -320,7 +320,7 @@ namespace Cap { public: MessageBase(const std::string& subcmd) - : ClientProtocol::Message("CAP", ServerInstance->Config->ServerName) + : ClientProtocol::Message("CAP", ServerInstance->Config->GetServerName()) { PushParamPlaceholder(); PushParam(subcmd); diff --git a/include/modules/ircv3_replies.h b/include/modules/ircv3_replies.h index 4666f002a..f3c5c451a 100644 --- a/include/modules/ircv3_replies.h +++ b/include/modules/ircv3_replies.h @@ -90,7 +90,7 @@ class IRCv3::Replies::Reply */ void Send(LocalUser* user, Command* command, const std::string& code, const std::string& description) { - ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName); + ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName()); msg.PushParamRef(command->name); msg.PushParam(code); msg.PushParam(description); @@ -100,7 +100,7 @@ class IRCv3::Replies::Reply template void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const std::string& description) { - ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName); + ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName()); msg.PushParamRef(command->name); msg.PushParam(code); msg.PushParam(ConvToStr(p1)); @@ -112,7 +112,7 @@ class IRCv3::Replies::Reply void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2, const std::string& description) { - ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName); + ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName()); msg.PushParamRef(command->name); msg.PushParam(code); msg.PushParam(ConvToStr(p1)); @@ -125,7 +125,7 @@ class IRCv3::Replies::Reply void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2, const T3& p3, const std::string& description) { - ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName); + ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName()); msg.PushParamRef(command->name); msg.PushParam(code); msg.PushParam(ConvToStr(p1)); @@ -139,7 +139,7 @@ class IRCv3::Replies::Reply void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2, const T3& p3, const T4& p4, const std::string& description) { - ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName); + ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName()); msg.PushParamRef(command->name); msg.PushParam(code); msg.PushParam(ConvToStr(p1)); @@ -154,7 +154,7 @@ class IRCv3::Replies::Reply void Send(LocalUser* user, Command* command, const std::string& code, const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const std::string& description) { - ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->ServerName); + ClientProtocol::Message msg(cmd.c_str(), ServerInstance->Config->GetServerName()); if (command) msg.PushParamRef(command->name); else diff --git a/include/numericbuilder.h b/include/numericbuilder.h index 9feceb7cb..a077c666d 100644 --- a/include/numericbuilder.h +++ b/include/numericbuilder.h @@ -86,7 +86,7 @@ class Numeric::GenericBuilder GenericBuilder(Sink s, unsigned int num, bool addparam = true, size_t additionalsize = 0) : sink(s) , numeric(num) - , max(ServerInstance->Config->Limits.MaxLine - ServerInstance->Config->ServerName.size() - additionalsize - 10) + , max(ServerInstance->Config->Limits.MaxLine - ServerInstance->Config->GetServerName().size() - additionalsize - 10) { if (addparam) numeric.push(std::string()); @@ -156,7 +156,7 @@ class Numeric::GenericParamBuilder : sink(s) , numeric(num) , currlen(0) - , max(ServerInstance->Config->Limits.MaxLine - ServerInstance->Config->ServerName.size() - additionalsize - 10) + , max(ServerInstance->Config->Limits.MaxLine - ServerInstance->Config->GetServerName().size() - additionalsize - 10) { } diff --git a/src/configreader.cpp b/src/configreader.cpp index b258d93fc..f96836507 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -335,7 +335,7 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) } } -static std::string GetServerName() +static std::string GetServerHost() { #ifndef _WIN32 char hostname[256]; @@ -359,7 +359,7 @@ void ServerConfig::Fill() ConfigTag* server = ConfValue("server"); if (sid.empty()) { - ServerName = server->getString("name", GetServerName(), InspIRCd::IsHost); + ServerName = server->getString("name", GetServerHost(), InspIRCd::IsHost); sid = server->getString("id"); if (!sid.empty() && !InspIRCd::IsSID(sid)) diff --git a/src/coremods/core_info/cmd_admin.cpp b/src/coremods/core_info/cmd_admin.cpp index e4764d5c9..07be23e68 100644 --- a/src/coremods/core_info/cmd_admin.cpp +++ b/src/coremods/core_info/cmd_admin.cpp @@ -39,7 +39,7 @@ CmdResult CommandAdmin::Handle(User* user, const Params& parameters) { if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName)) return CMD_SUCCESS; - user->WriteRemoteNumeric(RPL_ADMINME, ServerInstance->Config->ServerName, "Administrative info"); + user->WriteRemoteNumeric(RPL_ADMINME, ServerInstance->Config->GetServerName(), "Administrative info"); if (!AdminName.empty()) user->WriteRemoteNumeric(RPL_ADMINLOC1, InspIRCd::Format("Name: %s", AdminName.c_str())); user->WriteRemoteNumeric(RPL_ADMINLOC2, InspIRCd::Format("Nickname: %s", AdminNick.c_str())); diff --git a/src/coremods/core_info/cmd_motd.cpp b/src/coremods/core_info/cmd_motd.cpp index 69caf7de1..c9a542f14 100644 --- a/src/coremods/core_info/cmd_motd.cpp +++ b/src/coremods/core_info/cmd_motd.cpp @@ -57,7 +57,7 @@ CmdResult CommandMotd::Handle(User* user, const Params& parameters) return CMD_SUCCESS; } - user->WriteRemoteNumeric(RPL_MOTDSTART, InspIRCd::Format("%s message of the day", ServerInstance->Config->ServerName.c_str())); + user->WriteRemoteNumeric(RPL_MOTDSTART, InspIRCd::Format("%s message of the day", ServerInstance->Config->GetServerName().c_str())); for (file_cache::iterator i = motd->second.begin(); i != motd->second.end(); i++) user->WriteRemoteNumeric(RPL_MOTD, InspIRCd::Format(" %s", i->c_str())); diff --git a/src/coremods/core_info/cmd_time.cpp b/src/coremods/core_info/cmd_time.cpp index 3eab43b2a..a880d7a0e 100644 --- a/src/coremods/core_info/cmd_time.cpp +++ b/src/coremods/core_info/cmd_time.cpp @@ -37,7 +37,6 @@ CmdResult CommandTime::Handle(User* user, const Params& parameters) if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName)) return CMD_SUCCESS; - user->WriteRemoteNumeric(RPL_TIME, ServerInstance->Config->ServerName, InspIRCd::TimeString(ServerInstance->Time())); - + user->WriteRemoteNumeric(RPL_TIME, ServerInstance->Config->GetServerName(), InspIRCd::TimeString(ServerInstance->Time())); return CMD_SUCCESS; } diff --git a/src/coremods/core_info/core_info.cpp b/src/coremods/core_info/core_info.cpp index f138494c8..24eaaae03 100644 --- a/src/coremods/core_info/core_info.cpp +++ b/src/coremods/core_info/core_info.cpp @@ -134,7 +134,7 @@ class CoreModInfo : public Module void OnUserConnect(LocalUser* user) CXX11_OVERRIDE { user->WriteNumeric(RPL_WELCOME, InspIRCd::Format("Welcome to the %s IRC Network %s", ServerInstance->Config->Network.c_str(), user->GetFullRealHost().c_str())); - user->WriteNumeric(RPL_YOURHOST, InspIRCd::Format("Your host is %s, running version %s", ServerInstance->Config->ServerName.c_str(), INSPIRCD_BRANCH)); + user->WriteNumeric(RPL_YOURHOST, InspIRCd::Format("Your host is %s, running version %s", ServerInstance->Config->GetServerName().c_str(), INSPIRCD_BRANCH)); user->WriteNumeric(RPL_CREATED, InspIRCd::TimeString(ServerInstance->startup_time, "This server was created %H:%M:%S %b %d %Y")); user->WriteNumeric(numeric004); diff --git a/src/coremods/core_stub.cpp b/src/coremods/core_stub.cpp index 1e9c83024..0b7cfaa32 100644 --- a/src/coremods/core_stub.cpp +++ b/src/coremods/core_stub.cpp @@ -77,7 +77,7 @@ class CommandLinks : public Command */ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { - user->WriteNumeric(RPL_LINKS, ServerInstance->Config->ServerName, ServerInstance->Config->ServerName, InspIRCd::Format("0 %s", ServerInstance->Config->ServerDesc.c_str())); + user->WriteNumeric(RPL_LINKS, ServerInstance->Config->GetServerName(), ServerInstance->Config->GetServerName(), InspIRCd::Format("0 %s", ServerInstance->Config->GetServerDesc().c_str())); user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list."); return CMD_SUCCESS; } diff --git a/src/modules/m_ircv3_batch.cpp b/src/modules/m_ircv3_batch.cpp index bbb78557d..197ee3ebe 100644 --- a/src/modules/m_ircv3_batch.cpp +++ b/src/modules/m_ircv3_batch.cpp @@ -26,7 +26,7 @@ class BatchMessage : public ClientProtocol::Message { public: BatchMessage(const IRCv3::Batch::Batch& batch, bool start) - : ClientProtocol::Message("BATCH", ServerInstance->Config->ServerName) + : ClientProtocol::Message("BATCH", ServerInstance->Config->GetServerName()) { char c = (start ? '+' : '-'); PushParam(std::string(1, c) + batch.GetRefTagStr()); diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 4bc9c2fad..a408ff142 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -228,7 +228,7 @@ public: topicset = ServerInstance->Time(); std::string topicsetby = tag->getString("topicsetby"); if (topicsetby.empty()) - topicsetby = ServerInstance->Config->ServerName; + topicsetby = ServerInstance->Config->GetServerName(); c->SetTopic(ServerInstance->FakeClient, topic, topicset, &topicsetby); } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 1fd17c28a..01387c753 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -144,7 +144,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) return; user->WriteNumeric(RPL_LINKS, Current->GetName(), - (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->ServerName : Parent), + (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->GetServerName() : Parent), InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str())); } diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 0054e3ed7..bbbc9ba64 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -294,7 +294,7 @@ class ModuleSSLInfo std::string text = "*** You are connected to "; if (!ssliohook->GetServerName(text)) - text.append(ServerInstance->Config->ServerName); + text.append(ServerInstance->Config->GetServerName()); text.append(" using TLS (SSL) cipher '"); ssliohook->GetCiphersuite(text); text.push_back('\''); diff --git a/src/server.cpp b/src/server.cpp index 217d1501d..dbc51e37c 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -72,7 +72,7 @@ std::string InspIRCd::GetVersionString(bool getFullVersion) { if (getFullVersion) return INSPIRCD_VERSION ". " + Config->ServerName + " :[" + Config->sid + "] " + Config->CustomVersion; - return INSPIRCD_BRANCH ". " + Config->ServerName + " :" + Config->CustomVersion; + return INSPIRCD_BRANCH ". " + Config->GetServerName() + " :" + Config->CustomVersion; } std::string UIDGenerator::GenerateSID(const std::string& servername, const std::string& serverdesc) diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 812f43113..bb325f9ee 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -369,7 +369,7 @@ void UserManager::ServerNoticeAll(const char* text, ...) { std::string message; VAFORMAT(message, text, text); - ClientProtocol::Messages::Privmsg msg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, ServerInstance->Config->ServerName, message, MSG_NOTICE); + ClientProtocol::Messages::Privmsg msg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, ServerInstance->Config->GetServerName(), message, MSG_NOTICE); ClientProtocol::Event msgevent(ServerInstance->GetRFCEvents().privmsg, msg); for (LocalList::const_iterator i = local_users.begin(); i != local_users.end(); ++i) -- cgit v1.3.1-10-gc9f91