summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-11 12:15:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-11 12:15:11 +0000
commite4694e467513a7d4d298e55027e58bf9a7917958 (patch)
treef63fdf9bee5aeca2f58cf2f9d11422fe8858ee6c /src/command_parse.cpp
parenta1f682a211c3a073143d4ece7a2ea915a5ff089b (diff)
Oops, add special-case for user killing themselves (their userrec is gone when the function returns)
Also put checks in LoopCall to check that the user didnt vanish half way through the comma seperated list, if they did, abort at that element of the list. This means if your nick is 'a' and you do "/kill b,c,a,f,g die" only you, b and c will be removed from irc. (this is to be expected, really) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5684 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index b67b269d2..0abfc5b04 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -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;
}