diff options
-rw-r--r-- | include/ctables.h | 1 | ||||
-rw-r--r-- | src/cmd_kill.cpp | 5 | ||||
-rw-r--r-- | src/cmd_quit.cpp | 5 | ||||
-rw-r--r-- | src/command_parse.cpp | 5 |
4 files changed, 13 insertions, 3 deletions
diff --git a/include/ctables.h b/include/ctables.h index 9adf6c37c..ca2ef074b 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -32,6 +32,7 @@ enum CmdResult CMD_FAILURE = 0, /* Command exists, but failed */ CMD_SUCCESS = 1, /* Command exists, and succeeded */ CMD_INVALID = 2, /* Command doesnt exist at all! */ + CMD_USER_DELETED = 3, /* User was deleted! */ }; /** A structure that defines a command diff --git a/src/cmd_kill.cpp b/src/cmd_kill.cpp index 6fe855a19..dfcf99590 100644 --- a/src/cmd_kill.cpp +++ b/src/cmd_kill.cpp @@ -66,6 +66,11 @@ CmdResult cmd_kill::Handle (const char** parameters, int pcnt, userrec *user) u->PurgeEmptyChannels(); } + if (u == user) + { + FOREACH_MOD(I_OnPostCommand,OnPostCommand("KILL", parameters, pcnt, user, CMD_SUCCESS)); + return CMD_USER_DELETED; + } DELETE(u); } else diff --git a/src/cmd_quit.cpp b/src/cmd_quit.cpp index bf64aea3d..41cc48c8e 100644 --- a/src/cmd_quit.cpp +++ b/src/cmd_quit.cpp @@ -99,8 +99,9 @@ CmdResult cmd_quit::Handle (const char** parameters, int pcnt, userrec *user) if (user->registered == REG_ALL) { user->PurgeEmptyChannels(); } - DELETE(user); - return CMD_SUCCESS; + FOREACH_MOD(I_OnPostCommand,OnPostCommand("QUIT", parameters, pcnt, user, CMD_SUCCESS)); + DELETE(user); + return CMD_USER_DELETED; } diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 1545c8e1b..5cc85a2a3 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -386,7 +386,10 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd) */ CmdResult result = cm->second->Handle(command_p,items,user); - FOREACH_MOD(I_OnPostCommand,OnPostCommand(command, command_p, items, user, result)); + if (result != CMD_USER_DELETED) + { + FOREACH_MOD(I_OnPostCommand,OnPostCommand(command, command_p, items, user, result)); + } return; } else |