]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Add irc::dynamicbitmask class. Feel free to take a look and offer suggestions, as...
[user/henk/code/inspircd.git] / src / command_parse.cpp
index b67b269d20bd42e3ec115a5a510eaeec4a6f8a9c..d2b40806d3aa044574cd267990d24731b9e9d86d 100644 (file)
@@ -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))