]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_away.cpp
ConfigReader and FileReader now take InspIRCd* to their constructors
[user/henk/code/inspircd.git] / src / cmd_away.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #include <vector>
18 #include "inspircd_config.h"
19 #include "configreader.h"
20 #include "users.h"
21 #include "modules.h"
22 #include "commands.h"
23 #include "helperfuncs.h"
24 #include "commands/cmd_away.h"
25
26
27
28 void cmd_away::Handle (const char** parameters, int pcnt, userrec *user)
29 {
30         if (pcnt)
31         {
32                 strlcpy(user->awaymsg,parameters[0],MAXAWAY);
33                 user->WriteServ("306 %s :You have been marked as being away",user->nick);
34                 FOREACH_MOD(I_OnSetAway,OnSetAway(user));
35         }
36         else
37         {
38                 *user->awaymsg = 0;
39                 user->WriteServ("305 %s :You are no longer marked as being away",user->nick);
40                 FOREACH_MOD(I_OnCancelAway,OnCancelAway(user));
41         }
42 }