1 |
/* Online user data structure. |
2 |
* |
3 |
* IRC Services is copyright (c) 1996-2009 Andrew Church. |
4 |
* E-mail: <achurch@achurch.org> |
5 |
* Parts written by Andrew Kempe and others. |
6 |
* This program is free but copyrighted software; see the file GPL.txt for |
7 |
* details. |
8 |
*/ |
9 |
|
10 |
#ifndef USERS_H |
11 |
#define USERS_H |
12 |
|
13 |
/*************************************************************************/ |
14 |
|
15 |
struct user_ { |
16 |
User *next, *prev; |
17 |
User *snext,*sprev; /* Next/previous for the user's server |
18 |
* (unordered) */ |
19 |
|
20 |
char nick[NICKMAX]; |
21 |
NickInfo *ni; /* NickInfo for this nick */ |
22 |
NickGroupInfo *ngi; /* NickGroupInfo for this nick; guaranteed |
23 |
* valid if `ni' is non-NULL */ |
24 |
Server *server; /* Server user is on */ |
25 |
char *username; |
26 |
char *host; /* User's hostname */ |
27 |
char *realname; |
28 |
char *fakehost; /* Hostname seen by other users */ |
29 |
char *ipaddr; /* User's IP address in string form (takes |
30 |
* more memory but saves CPU work and |
31 |
* gives free compatibility with IPv6) */ |
32 |
|
33 |
time_t signon; /* Timestamp sent (from remote server) with |
34 |
* user when they connected */ |
35 |
time_t my_signon; /* Our local timestamp when the user |
36 |
* connected */ |
37 |
uint32 servicestamp; /* ID value for user; used in split recovery */ |
38 |
int32 mode; /* UMODE_* user modes */ |
39 |
int16 flags; /* UF_* status flags */ |
40 |
|
41 |
double ignore; /* Ignore level */ |
42 |
uint32 lastcmd; /* Time of last command, from time_msec() */ |
43 |
time_t lastcmd_s; /* Same from time(), to check rollover */ |
44 |
|
45 |
int16 bad_pw_count; /* # of invalid password attempts */ |
46 |
time_t bad_pw_time; /* Time of last invalid password */ |
47 |
time_t lastmemosend; /* Last time MS SEND command used */ |
48 |
time_t lastmemofwd; /* Last time MS FORWARD command used */ |
49 |
time_t lastnickreg; /* Last time NS REGISTER command used */ |
50 |
time_t last_nick_set_email; /* Last time NS SET EMAIL command used */ |
51 |
|
52 |
uint32 *id_nicks; |
53 |
int id_nicks_count; |
54 |
|
55 |
struct u_chanlist { /* Channels user has joined */ |
56 |
struct u_chanlist *next, *prev; |
57 |
Channel *chan; |
58 |
} *chans; |
59 |
|
60 |
struct u_chaninfolist { /* Channels user has identified for */ |
61 |
struct u_chaninfolist *next, *prev; |
62 |
char chan[CHANMAX]; |
63 |
} *id_chans; |
64 |
}; |
65 |
|
66 |
|
67 |
/* Status flags: */ |
68 |
#define UF_SERVROOT 0x0001 /* User has Services root privileges */ |
69 |
|
70 |
/*************************************************************************/ |
71 |
|
72 |
#endif /* USERS_H */ |
73 |
|
74 |
/* |
75 |
* Local variables: |
76 |
* c-file-style: "stroustrup" |
77 |
* c-file-offsets: ((case-label . *) (statement-case-intro . *)) |
78 |
* indent-tabs-mode: nil |
79 |
* End: |
80 |
* |
81 |
* vim: expandtab shiftwidth=4: |
82 |
*/ |