From 782c8303d7dbf379e1cd807b59ec6a0ba701ca7d Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 17 Jun 2014 13:45:57 +0200 Subject: [PATCH] Update the description field in the Server object representing the local server on rehash --- include/server.h | 9 +++++++-- src/configreader.cpp | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/server.h b/include/server.h index 3d8854734..e54a379bc 100644 --- a/include/server.h +++ b/include/server.h @@ -26,9 +26,10 @@ class CoreExport Server : public classbase */ const std::string name; - /** The description of this server + /** The description of this server. + * This can be updated by the protocol module (for remote servers) or by a rehash (for the local server). */ - const std::string description; + std::string description; /** True if this server is ulined */ @@ -38,6 +39,10 @@ class CoreExport Server : public classbase */ bool silentuline; + /** Allow ConfigReaderThread to update the description on a rehash + */ + friend class ConfigReaderThread; + public: Server(const std::string& srvname, const std::string& srvdesc) : name(srvname), description(srvdesc), uline(false), silentuline(false) { } diff --git a/src/configreader.cpp b/src/configreader.cpp index 0ec53c482..a922543a3 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -783,6 +783,9 @@ void ConfigReaderThread::Finish() for (ModuleManager::ModuleMap::const_iterator i = mods.begin(); i != mods.end(); ++i) i->second->ReadConfig(status); + // The description of this server may have changed - update it for WHOIS etc. + ServerInstance->FakeClient->server->description = Config->ServerDesc; + ServerInstance->ISupport.Build(); ServerInstance->Logs->CloseLogs(); -- 2.39.5