From e6ce64246b2cff2adcb66366727e095afe6ff197 Mon Sep 17 00:00:00 2001 From: peavey Date: Sat, 2 Jun 2007 01:32:59 +0000 Subject: Fix for bug #297. /MODULES now correctly finds remote server on wildcard. Marked for QA. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7206 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index a134d95e1..7aa09ba7a 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -267,17 +267,24 @@ int ModuleSpanningTree::HandleAdmin(const char** parameters, int pcnt, userrec* int ModuleSpanningTree::HandleModules(const char** parameters, int pcnt, userrec* user) { - if (match(ServerInstance->Config->ServerName, parameters[0])) - return 1; + if (pcnt > 0) + { + if (match(ServerInstance->Config->ServerName, parameters[0])) + return 1; - std::deque params; - params.push_back(parameters[0]); - TreeServer* s = Utils->FindServerMask(parameters[0]); - if (s) - Utils->DoOneToOne(user->nick, "MODULES", params, s->GetName()); - else - user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0]); - return 1; + std::deque params; + params.push_back(parameters[0]); + TreeServer* s = Utils->FindServerMask(parameters[0]); + if (s) + { + params[0] = s->GetName(); + Utils->DoOneToOne(user->nick, "MODULES", params, s->GetName()); + } + else + user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0]); + return 1; + } + return 0; } int ModuleSpanningTree::HandleStats(const char** parameters, int pcnt, userrec* user) -- cgit v1.2.3