diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-01-05 15:20:17 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-05 15:20:17 +0100 |
commit | 9136136ac373a922cd0875f77d3212a419fb9100 (patch) | |
tree | 385afcb56e62de5a39bed1d7bf6d5311cc001df9 /src/modules | |
parent | 11916574f67962dce1d7a2fdf7ef6a3d2d1fa49f (diff) |
Move server description field from TreeServer into Server; remove OnGetServerDescription hook
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 11 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 1 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.h | 5 |
4 files changed, 5 insertions, 25 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 3efd012ba..9a7cddec3 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -408,15 +408,6 @@ void ModuleSpanningTree::On005Numeric(std::map<std::string, std::string>& tokens tokens["MAP"]; } -void ModuleSpanningTree::OnGetServerDescription(const std::string &servername,std::string &description) -{ - TreeServer* s = Utils->FindServer(servername); - if (s) - { - description = s->GetDesc(); - } -} - void ModuleSpanningTree::OnUserInvite(User* source,User* dest,Channel* channel, time_t expiry) { if (IS_LOCAL(source)) @@ -754,7 +745,7 @@ ModuleSpanningTree::~ModuleSpanningTree() delete ServerInstance->PI; ServerInstance->PI = new ProtocolInterface; - Server* newsrv = new Server(ServerInstance->Config->ServerName); + Server* newsrv = new Server(ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc); SetLocalUsersServer(newsrv); /* This will also free the listeners */ diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index bef94a53b..513e86a2f 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -140,7 +140,6 @@ class ModuleSpanningTree : public Module ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE; void OnPostCommand(Command*, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line) CXX11_OVERRIDE; - void OnGetServerDescription(const std::string &servername,std::string &description) CXX11_OVERRIDE; void OnUserConnect(LocalUser* source) CXX11_OVERRIDE; void OnUserInvite(User* source,User* dest,Channel* channel, time_t) CXX11_OVERRIDE; void OnPostTopicChange(User* user, Channel* chan, const std::string &topic) CXX11_OVERRIDE; diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index 34b71e07f..ecde17261 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -33,8 +33,8 @@ * no socket associated with it. Its version string is our own local version. */ TreeServer::TreeServer() - : Server(ServerInstance->Config->ServerName) - , Parent(NULL), Route(NULL), ServerDesc(ServerInstance->Config->ServerDesc) + : Server(ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc) + , Parent(NULL), Route(NULL) , VersionString(ServerInstance->GetVersionString()), Socket(NULL), sid(ServerInstance->Config->GetSID()), ServerUser(ServerInstance->FakeClient) , age(ServerInstance->Time()), Warned(false), bursting(false), UserCount(0), OperCount(0), rtt(0), StartBurst(0), Hidden(false) { @@ -46,8 +46,8 @@ TreeServer::TreeServer() * its ping counters so that it will be pinged one minute from now. */ TreeServer::TreeServer(const std::string& Name, const std::string& Desc, const std::string& id, TreeServer* Above, TreeSocket* Sock, bool Hide) - : Server(Name) - , Parent(Above), ServerDesc(Desc), Socket(Sock), sid(id), ServerUser(new FakeUser(id, this)) + : Server(Name, Desc) + , Parent(Above), Socket(Sock), sid(id), ServerUser(new FakeUser(id, this)) , age(ServerInstance->Time()), Warned(false), bursting(true), UserCount(0), OperCount(0), rtt(0), Hidden(Hide) { CheckULine(); @@ -186,11 +186,6 @@ TreeServer* TreeServer::GetRoute() return Route; } -const std::string& TreeServer::GetDesc() -{ - return ServerDesc; -} - const std::string& TreeServer::GetVersion() { return VersionString; diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index 67ce96e63..ab47012b0 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -42,7 +42,6 @@ class TreeServer : public Server TreeServer* Parent; /* Parent entry */ TreeServer* Route; /* Route entry */ std::vector<TreeServer*> Children; /* List of child objects */ - std::string ServerDesc; /* Server's description */ std::string VersionString; /* Version string or empty string */ TreeSocket* Socket; /* Socket used to communicate with this server */ time_t NextPing; /* After this time, the server should be PINGed*/ @@ -93,10 +92,6 @@ class TreeServer : public Server */ bool IsLocal() const { return (this->Route == this); } - /** Get server description (GECOS) - */ - const std::string& GetDesc(); - /** Get server version string */ const std::string& GetVersion(); |