summaryrefslogtreecommitdiff
path: root/src/cmd_quit.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-17 14:01:53 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-17 14:01:53 +0000
commit3a7dd5b129450b94e0a87b8ad5009da70905b8e5 (patch)
treeba05bf4834f03c4c1450ec83bd5b238d055b3d5f /src/cmd_quit.cpp
parente166642755b17a56053d57dbd597e2fa38bb96c6 (diff)
Add const std::string &original_command to OnPreCommand and OnPostCommand, which gives the entire untouched command string and params in all its colon-ny glory
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5265 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_quit.cpp')
-rw-r--r--src/cmd_quit.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/cmd_quit.cpp b/src/cmd_quit.cpp
index 41cc48c8e..26502c385 100644
--- a/src/cmd_quit.cpp
+++ b/src/cmd_quit.cpp
@@ -31,6 +31,7 @@ CmdResult cmd_quit::Handle (const char** parameters, int pcnt, userrec *user)
{
user_hash::iterator iter = ServerInstance->clientlist.find(user->nick);
char reason[MAXBUF];
+ std::string quitmsg = "Client exited";
if (user->registered == REG_ALL)
{
@@ -47,9 +48,11 @@ CmdResult cmd_quit::Handle (const char** parameters, int pcnt, userrec *user)
*/
if (IS_LOCAL(user))
{
- user->Write("ERROR :Closing link (%s@%s) [%s%s]",user->ident,user->host,ServerInstance->Config->PrefixQuit,parameters[0]);
- ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s%s]",user->nick,user->ident,user->host,ServerInstance->Config->PrefixQuit,parameters[0]);
- user->WriteCommonExcept("QUIT :%s%s",ServerInstance->Config->PrefixQuit,parameters[0]);
+ quitmsg = ServerInstance->Config->PrefixQuit;
+ quitmsg.append(parameters[0]);
+ user->Write("ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,quitmsg.c_str());
+ ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,quitmsg.c_str());
+ user->WriteCommonExcept("QUIT :%s", quitmsg.c_str());
}
else
{
@@ -63,7 +66,7 @@ CmdResult cmd_quit::Handle (const char** parameters, int pcnt, userrec *user)
{
if (IS_LOCAL(user))
{
- user->Write("ERROR :Closing link (%s@%s) [QUIT]",user->ident,user->host);
+ user->Write("ERROR :Closing link (%s@%s) []",user->ident,user->host);
ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [Client exited]",user->nick,user->ident,user->host);
}
else
@@ -100,7 +103,12 @@ CmdResult cmd_quit::Handle (const char** parameters, int pcnt, userrec *user)
user->PurgeEmptyChannels();
}
- FOREACH_MOD(I_OnPostCommand,OnPostCommand("QUIT", parameters, pcnt, user, CMD_SUCCESS));
+ if (IS_LOCAL(user))
+ {
+ std::string original_command = "QUIT :" + quitmsg;
+ FOREACH_MOD(I_OnPostCommand,OnPostCommand("QUIT", parameters, pcnt, user, CMD_SUCCESS, original_command));
+ }
+
DELETE(user);
return CMD_USER_DELETED;
}