]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Bad w00tie bad, /who isnt checking +s for channel /who!
[user/henk/code/inspircd.git] / src / command_parse.cpp
index b67b269d20bd42e3ec115a5a510eaeec4a6f8a9c..8d1955e7e70e43a0c9a6d2c06ff0750116285494 100644 (file)
@@ -37,10 +37,10 @@ bool InspIRCd::ULine(const char* server)
        return (find(Config->ulines.begin(),Config->ulines.end(),server) != Config->ulines.end());
 }
 
-int InspIRCd::OperPassCompare(const char* data,const char* input)
+int InspIRCd::OperPassCompare(const char* data,const char* input, int tagnumber)
 {
        int MOD_RESULT = 0;
-       FOREACH_RESULT_I(this,I_OnOperCompare,OnOperCompare(data,input))
+       FOREACH_RESULT_I(this,I_OnOperCompare,OnOperCompare(data, input, tagnumber))
        Log(DEBUG,"OperPassCompare: %d",MOD_RESULT);
        if (MOD_RESULT == 1)
                return 0;
@@ -241,7 +241,8 @@ int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** p
                        new_parameters[splithere] = item.c_str();
                        new_parameters[extra] = extrastuff.c_str();
 
-                       CommandObj->Handle(new_parameters,pcnt,user);
+                       if (CommandObj->Handle(new_parameters,pcnt,user) == CMD_USER_DELETED)
+                               return 1;
 
                        dupes[item.c_str()] = true;
                }
@@ -281,7 +282,13 @@ int CommandParser::LoopCall(userrec* user, command_t* CommandObj, const char** p
                        new_parameters[splithere] = item.c_str();
 
                        parameters[splithere] = item.c_str();
-                       CommandObj->Handle(new_parameters,pcnt,user);
+
+                       /* 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.
+                        */
+                       if (CommandObj->Handle(new_parameters,pcnt,user) == CMD_USER_DELETED)
+                               return 1;
 
                        dupes[item.c_str()] = true;
                }
@@ -385,7 +392,7 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
                        {
                                if (!user->IsModeSet(cm->second->flags_needed))
                                {
-                                       user->WriteServ("481 %s :Permission Denied- You do not have the required operator privilages",user->nick);
+                                       user->WriteServ("481 %s :Permission Denied- You do not have the required operator privileges",user->nick);
                                        return;
                                }
                                if (!user->HasPermission(command))