X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_commands.cpp;h=99acdfe963cb13f756d65eed39bcc7b2f4540646;hb=dafa2f3031c4abc7f5506385770c4fc743669b17;hp=2d4d42a1f4c26611f34fd986fa9c8c598bf86e16;hpb=46a39046196f55b52336e19662bb7bac85b731ac;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_commands.cpp b/src/commands/cmd_commands.cpp index 2d4d42a1f..99acdfe96 100644 --- a/src/commands/cmd_commands.cpp +++ b/src/commands/cmd_commands.cpp @@ -20,14 +20,6 @@ #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 @@ -48,9 +40,6 @@ class CommandCommands : public Command CmdResult Handle(const std::vector& parameters, User *user); }; -#endif - - /** Handle /COMMANDS */ CmdResult CommandCommands::Handle (const std::vector&, User *user) @@ -59,13 +48,14 @@ CmdResult CommandCommands::Handle (const std::vector&, 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", - ServerInstance->Config->ServerName.c_str(), RPL_COMMANDS, user->nick.c_str(), - i->second->name.c_str(), src->ModuleSourceFile.c_str(), - i->second->min_params, i->second->Penalty); - list.push_back(buffer); + list.push_back(InspIRCd::Format(":%s %03d %s :%s %s %d %d", ServerInstance->Config->ServerName.c_str(), + RPL_COMMANDS, user->nick.c_str(), i->second->name.c_str(), src->ModuleSourceFile.c_str(), + i->second->min_params, i->second->Penalty)); } sort(list.begin(), list.end()); for(unsigned int i=0; i < list.size(); i++)