]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_ison.cpp
More cleanup
[user/henk/code/inspircd.git] / src / cmd_ison.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 using namespace std;
18
19 #include "inspircd_config.h"
20 #include "inspircd.h"
21 #include "inspircd_io.h"
22 #include <string>
23 #include "users.h"
24 #include "ctables.h"
25 #include "globals.h"
26 #include "modules.h"
27 #include "dynamic.h"
28 #include "wildcard.h"
29 #include "message.h"
30 #include "commands.h"
31 #include "inspstring.h"
32 #include "helperfuncs.h"
33 #include "hashcomp.h"
34 #include "typedefs.h"
35 #include "cmd_ison.h"
36
37 void cmd_ison::Handle (char **parameters, int pcnt, userrec *user)
38 {
39         char retbuf[MAXBUF];
40         userrec *u;
41
42         snprintf(retbuf, MAXBUF, "303 %s :", user->nick);
43
44         for (int i = 0; i < pcnt; i++)
45         {
46                 u = Find(parameters[i]);
47
48                 if (u)
49                 {
50                         strlcat(retbuf, u->nick, MAXBUF);
51                         charlcat(retbuf, ' ', MAXBUF);
52                 }
53         }
54
55         WriteServ(user->fd, retbuf);
56 }
57
58
59