added some code
[NextIRCd.git] / src / struct_client.h
1 /* struct_client.h - NextIRCd
2  * Copyright (C) 2012-2013  Philipp Kreil (pk910)
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License 
15  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
16  */
17
18 #ifndef _struct_client_h
19 #define _struct_client_h
20 #include <time.h>
21
22 #include "crypt_md5.h"
23 #include "struct_user.h"
24
25 struct Connection;
26 struct User;
27
28 struct ClientNickChange;
29
30 #define AWAYLEN  300
31
32 /* Client represents a local User */
33 struct Client {
34     struct Connection *conn;
35         struct User *user;
36         
37         struct ClientNickChange *nickchange;
38         
39         time_t userage;
40         time_t nickage;
41         time_t lastping;
42         time_t idlelen;
43     
44         char *userage_sign;
45         char *nickage_sign;
46         
47         char awaymsg[AWAYLEN-1];
48         
49         unsigned int isonline : 1;
50         unsigned int isaway : 1;
51         
52         struct Client *prev, *next;
53 };
54
55 struct ClientNickChange {
56         char newnick[NICKLEN+1];
57         char nickhash[MDHASHLEN];
58 };
59
60 #endif