diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/cmd_whois.cpp | 3 | ||||
-rw-r--r-- | src/helperfuncs.cpp | 17 | ||||
-rw-r--r-- | src/inspircd.cpp | 2 | ||||
-rw-r--r-- | src/modules.cpp | 1 | ||||
-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 |
8 files changed, 7 insertions, 46 deletions
diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index fdc2ad045..7e67676ed 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -144,8 +144,7 @@ void CommandWhois::DoWhois(User* user, User* dest, unsigned long signon, unsigne } else { - std::string serverdesc = ServerInstance->GetServerDescription(dest->server->GetName()); - ServerInstance->SendWhoisLine(user, dest, 312, "%s %s :%s", dest->nick.c_str(), dest->server->GetName().c_str(), serverdesc.c_str()); + ServerInstance->SendWhoisLine(user, dest, 312, "%s %s :%s", dest->nick.c_str(), dest->server->GetName().c_str(), dest->server->GetDesc().c_str()); } if (dest->IsAway()) diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 655bf9ae4..6a831bb04 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -32,23 +32,6 @@ #include "exitcodes.h" #include <iostream> -std::string InspIRCd::GetServerDescription(const std::string& servername) -{ - std::string description; - - FOREACH_MOD(OnGetServerDescription, (servername,description)); - - if (!description.empty()) - { - return description; - } - else - { - // not a remote server that can be found, it must be me. - return Config->ServerDesc; - } -} - /* Find a user record by nickname and return a pointer to it */ User* InspIRCd::FindNick(const std::string &nick) { diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 50feab459..75e9f3699 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -460,7 +460,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : this->UIDGen.init(Config->sid); // Create the server user for this server - this->FakeClient = new FakeUser(Config->sid, Config->ServerName); + this->FakeClient = new FakeUser(Config->sid, Config->ServerName, Config->ServerDesc); // This is needed as all new XLines are marked pending until ApplyLines() is called this->XLines->ApplyLines(); diff --git a/src/modules.cpp b/src/modules.cpp index 2157d1948..5c5e4febc 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -132,7 +132,6 @@ void Module::OnPostConnect(User*) { DetachEvent(I_OnPostConnect); } void Module::OnUserMessage(User*, void*, int, const std::string&, char, const CUList&, MessageType) { DetachEvent(I_OnUserMessage); } void Module::OnUserInvite(User*, User*, Channel*, time_t) { DetachEvent(I_OnUserInvite); } void Module::OnPostTopicChange(User*, Channel*, const std::string&) { DetachEvent(I_OnPostTopicChange); } -void Module::OnGetServerDescription(const std::string&, std::string&) { DetachEvent(I_OnGetServerDescription); } void Module::OnSyncUser(User*, ProtocolInterface::Server&) { DetachEvent(I_OnSyncUser); } void Module::OnSyncChannel(Channel*, ProtocolInterface::Server&) { DetachEvent(I_OnSyncChannel); } void Module::OnSyncNetwork(ProtocolInterface::Server&) { DetachEvent(I_OnSyncNetwork); } 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(); |