diff options
author | Sadie Powell <sadie@witchery.services> | 2020-12-20 03:04:21 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-12-20 03:05:29 +0000 |
commit | 6cfabb0064cab52bbbab59974e53dc0fa1954da7 (patch) | |
tree | aa755e92103730ba6428332b4094578cde91cc67 /src | |
parent | 029ff235e184acc8194e76ef535e437cb6c9f614 (diff) |
Hide the server name/desc better when <options:hideserver> is set.
Diffstat (limited to 'src')
-rw-r--r-- | src/configreader.cpp | 4 | ||||
-rw-r--r-- | src/coremods/core_info/cmd_admin.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_info/cmd_motd.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_info/cmd_time.cpp | 3 | ||||
-rw-r--r-- | src/coremods/core_info/core_info.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_stub.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_ircv3_batch.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_permchannels.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_sslinfo.cpp | 2 | ||||
-rw-r--r-- | src/server.cpp | 2 | ||||
-rw-r--r-- | src/usermanager.cpp | 2 |
12 files changed, 13 insertions, 14 deletions
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) |