]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_quit.cpp
/who tidyup - needs QA'ing
[user/henk/code/inspircd.git] / src / cmd_quit.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "configreader.h"
16 #include "users.h"
17 #include "modules.h"
18 #include "commands/cmd_quit.h"
19
20
21
22 extern "C" command_t* init_command(InspIRCd* Instance)
23 {
24         return new cmd_quit(Instance);
25 }
26
27 CmdResult cmd_quit::Handle (const char** parameters, int pcnt, userrec *user)
28 {
29
30         std::string quitmsg;
31
32         if (IS_LOCAL(user))
33                 quitmsg = pcnt ? ServerInstance->Config->PrefixQuit + std::string(parameters[0]) : "Client exited";
34         else
35                 quitmsg = pcnt ? parameters[0] : "Client exited";
36
37         userrec::QuitUser(ServerInstance, user, quitmsg);
38
39         return CMD_SUCCESS;
40 }
41