]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Wheee, mass commit! this adds const stafety, throwing a compile error if anyone does...
[user/henk/code/inspircd.git] / src / command_parse.cpp
index d82f523dbf7b7918d8bb5658df59931b34745cb3..57a86b0cde18b1e0a42ffd0e87c08118aef2b9da 100644 (file)
 #include <dlfcn.h>
 #endif
 
-int InspIRCd::OperPassCompare(const char* data,const char* input, int tagnumber)
+int InspIRCd::PassCompare(Extensible* ex, const char* data,const char* input, const char* hashtype)
 {
        int MOD_RESULT = 0;
-       FOREACH_RESULT_I(this,I_OnOperCompare,OnOperCompare(data, input, tagnumber))
+       FOREACH_RESULT_I(this,I_OnPassCompare,OnPassCompare(ex, data, input, hashtype))
        if (MOD_RESULT == 1)
                return 0;
        if (MOD_RESULT == -1)
@@ -48,7 +48,7 @@ int InspIRCd::OperPassCompare(const char* data,const char* input, int tagnumber)
  * The second version is much simpler and just has the one stream to read, and is used in NAMES, WHOIS, PRIVMSG etc.
  * Both will only parse until they reach ServerInstance->Config->MaxTargets number of targets, to stop abuse via spam.
  */
-int CommandParser::LoopCall(User* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra)
+int CommandParser::LoopCall(User* user, Command* CommandObj, const char* const* parameters, int pcnt, unsigned int splithere, unsigned int extra)
 {
        /* First check if we have more than one item in the list, if we don't we return zero here and the handler
         * which called us just carries on as it was.
@@ -97,7 +97,7 @@ int CommandParser::LoopCall(User* user, Command* CommandObj, const char** parame
        return 1;
 }
 
-int CommandParser::LoopCall(User* user, Command* CommandObj, const char** parameters, int pcnt, unsigned int splithere)
+int CommandParser::LoopCall(User* user, Command* CommandObj, const char* const* parameters, int pcnt, unsigned int splithere)
 {
        /* First check if we have more than one item in the list, if we don't we return zero here and the handler
         * which called us just carries on as it was.
@@ -127,8 +127,6 @@ int CommandParser::LoopCall(User* user, Command* CommandObj, const char** parame
 
                        new_parameters[splithere] = item.c_str();
 
-                       parameters[splithere] = item.c_str();
-
                        /* Execute the command handler over and over. If someone pulls our user
                         * record out from under us (e.g. if we /kill a comma sep list, and we're
                         * in that list ourselves) abort if we're gone.
@@ -180,7 +178,7 @@ Command* CommandParser::GetHandler(const std::string &commandname)
 
 // calls a handler function for a command
 
-CmdResult CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, User *user)
+CmdResult CommandParser::CallHandler(const std::string &commandname,const char* const* parameters, int pcnt, User *user)
 {
        Commandable::iterator n = cmdlist.find(commandname);
 
@@ -354,7 +352,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
                cm->second->total_bytes += cmd.length();
 
                /* module calls too */
-               int MOD_RESULT = 0;
+               MOD_RESULT = 0;
                FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command,command_p,items,user,true,cmd));
                if (MOD_RESULT == 1)
                        return do_more;
@@ -413,12 +411,10 @@ bool CommandParser::ProcessBuffer(std::string &buffer,User *user)
 
        if (buffer.length())
        {
-               if (!user->muted)
-               {
-                       ServerInstance->Log(DEBUG,"C[%d] I :%s %s",user->GetFd(), user->nick, buffer.c_str());
-                       return this->ProcessCommand(user,buffer);
-               }
+               ServerInstance->Logs->Log("USERINPUT", DEBUG,"C[%d] I :%s %s",user->GetFd(), user->nick, buffer.c_str());
+               return this->ProcessCommand(user,buffer);
        }
+
        return true;
 }
 
@@ -502,13 +498,13 @@ bool CommandParser::ReloadCommand(const char* cmd, User* user)
        return false;
 }
 
-CmdResult cmd_reload::Handle(const char** parameters, int /* pcnt */, User *user)
+CmdResult cmd_reload::Handle(const char* const* parameters, int /* pcnt */, User *user)
 {
        user->WriteServ("NOTICE %s :*** Reloading command '%s'",user->nick, parameters[0]);
        if (ServerInstance->Parser->ReloadCommand(parameters[0], user))
        {
                user->WriteServ("NOTICE %s :*** Successfully reloaded command '%s'", user->nick, parameters[0]);
-               ServerInstance->WriteOpers("*** RELOAD: %s reloaded the '%s' command.", user->nick, parameters[0]);
+               ServerInstance->SNO->WriteToSnoMask('A', "RELOAD: %s reloaded the '%s' command.", user->nick, parameters[0]);
                return CMD_SUCCESS;
        }
        else