summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/commands/cmd_stats.h2
-rw-r--r--src/cmd_stats.cpp2
-rw-r--r--src/modules/m_spanningtree/main.cpp14
3 files changed, 15 insertions, 3 deletions
diff --git a/include/commands/cmd_stats.h b/include/commands/cmd_stats.h
index 00fada769..632bfa17b 100644
--- a/include/commands/cmd_stats.h
+++ b/include/commands/cmd_stats.h
@@ -30,7 +30,7 @@ void DoStats(InspIRCd* Instance, char statschar, userrec* user, string_list &res
class cmd_stats : public command_t
{
public:
- cmd_stats (InspIRCd* Instance) : command_t(Instance,"STATS",0,1) { syntax = "[<servername>] <stats-symbol>"; }
+ cmd_stats (InspIRCd* Instance) : command_t(Instance,"STATS",0,1) { syntax = "<stats-symbol> [<servername>]"; }
CmdResult Handle(const char** parameters, int pcnt, userrec *user);
};
diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp
index e2e94db4f..7197b15df 100644
--- a/src/cmd_stats.cpp
+++ b/src/cmd_stats.cpp
@@ -28,7 +28,7 @@ extern "C" command_t* init_command(InspIRCd* Instance)
CmdResult cmd_stats::Handle (const char** parameters, int pcnt, userrec *user)
{
- if (pcnt < 2)
+ if (IS_LOCAL(user))
{
string_list values;
DoStats(this->ServerInstance, *parameters[0], user, values);
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 4fa165d10..60d332c57 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -241,19 +241,31 @@ int ModuleSpanningTree::HandleStats(const char** parameters, int pcnt, userrec*
{
if (pcnt > 1)
{
+ ServerInstance->Log(DEBUG,"Match %s against %s", ServerInstance->Config->ServerName, parameters[1]);
+ if (match(ServerInstance->Config->ServerName, parameters[1]))
+ {
+ ServerInstance->Log(DEBUG,"Matched %s against %s", ServerInstance->Config->ServerName, parameters[1]);
+ return 0;
+ }
+
/* Remote STATS, the server is within the 2nd parameter */
std::deque<std::string> params;
params.push_back(parameters[0]);
params.push_back(parameters[1]);
/* Send it out remotely, generate no reply yet */
+
TreeServer* s = Utils->FindServerMask(parameters[1]);
if (s)
{
+ ServerInstance->Log(DEBUG,"Found %s", s->GetName().c_str());
+
params[1] = s->GetName();
Utils->DoOneToOne(user->nick, "STATS", params, s->GetName());
}
else
- user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0]);
+ {
+ user->WriteServ( "402 %s %s :No such server", user->nick, parameters[1]);
+ }
return 1;
}
return 0;