]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_commands.cpp
Merge pull request #1157 from SaberUK/insp20+fix-cron-restart
[user/henk/code/inspircd.git] / src / commands / cmd_commands.cpp
index 2d4d42a1f4c26611f34fd986fa9c8c598bf86e16..1555b4d0443198d69bac2fb298cedafa749d5ba2 100644 (file)
 
 #include "inspircd.h"
 
-#ifndef CMD_COMMANDS_H
-#define CMD_COMMANDS_H
-
-// include the common header files
-
-#include "users.h"
-#include "channels.h"
-
 /** Handle /COMMANDS. These command handlers can be reloaded by the core,
  * and handle basic RFC1459 commands. Commands within modules work
  * the same way, however, they can be fully unloaded, where these
@@ -38,7 +30,11 @@ class CommandCommands : public Command
  public:
        /** Constructor for commands.
         */
-       CommandCommands ( Module* parent) : Command(parent,"COMMANDS",0,0) { }
+       CommandCommands(Module* parent) : Command(parent,"COMMANDS",0,0)
+       {
+               Penalty = 3;
+       }
+
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
@@ -48,9 +44,6 @@ class CommandCommands : public Command
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
 };
 
-#endif
-
-
 /** Handle /COMMANDS
  */
 CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user)
@@ -59,6 +52,10 @@ CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user)
        list.reserve(ServerInstance->Parser->cmdlist.size());
        for (Commandtable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
        {
+               // Don't show S2S commands to users
+               if (i->second->flags_needed == FLAG_SERVERONLY)
+                       continue;
+
                Module* src = i->second->creator;
                char buffer[MAXBUF];
                snprintf(buffer, MAXBUF, ":%s %03d %s :%s %s %d %d",