]>
Commit | Line | Data |
---|---|---|
c86edd1d Q |
1 | /* new H user, a little more than N's user */ |
2 | #ifndef HUSER_H | |
3 | #define HUSER_H | |
4 | ||
5 | #include <time.h> | |
6 | ||
7 | #include "../lib/sstring.h" | |
8 | #include "../nick/nick.h" | |
9 | #include "../channel/channel.h" | |
10 | ||
11 | #include "hchannel.h" | |
12 | #include "haccount.h" | |
13 | ||
9af95c3d | 14 | #include "hed.h" |
c86edd1d Q |
15 | #include "helpmod_entries.h" |
16 | ||
17 | #define H_USRFLAGS_DEFAULT 0 | |
18 | ||
19 | typedef struct huser_struct | |
20 | { | |
21 | /* the real N user, channel information etc. can be gotten from this */ | |
22 | nick *real_user; | |
23 | int flags; | |
24 | haccount *account; | |
25 | ||
26 | helpmod_entry state; /* for old H */ | |
27 | ||
28 | time_t last_activity; | |
29 | ||
30 | /* for the lamer control, global -> can detect lame amsg's */ | |
31 | char last_line[512]; | |
32 | int last_line_repeats; | |
33 | ||
34 | double spam_val; | |
35 | int flood_val; | |
36 | ||
37 | int lc[5]; | |
38 | /* end lamer control */ | |
39 | ||
9af95c3d | 40 | helpmod_editor *editor; |
41 | ||
c86edd1d Q |
42 | struct huser_channel_struct *hchannels; |
43 | ||
44 | struct huser_struct *next; | |
45 | } huser; | |
46 | ||
47 | enum | |
48 | { | |
49 | HCUMODE_OP = 1 << 0, | |
50 | HCUMODE_VOICE = 1 << 1, | |
51 | HQUEUE_DONE = 1 << 2, | |
52 | H_IDLE_WARNING = 1 << 3 | |
53 | }; | |
54 | ||
55 | typedef struct huser_channel_struct | |
56 | { | |
57 | int flags; | |
58 | struct hchannel_struct *hchan; | |
59 | ||
60 | time_t last_activity; | |
61 | /* for queue, tells us who was the oper for this user */ | |
62 | huser *responsible_oper; | |
63 | ||
64 | struct huser_channel_struct *next; | |
65 | } huser_channel; | |
66 | ||
67 | ||
68 | extern huser *husers; | |
69 | ||
70 | huser *huser_add(nick*); | |
71 | void huser_del(huser*); | |
72 | void huser_del_all(); | |
73 | huser *huser_get(nick*); | |
74 | ||
75 | /* indicates that the user did something, channel is optional */ | |
76 | void huser_activity(huser*, hchannel *); | |
77 | ||
78 | void huser_clear_inactives(void); | |
79 | int huser_count(void); | |
80 | void huser_reset_states(void); | |
81 | ||
82 | hlevel huser_get_level(huser*); | |
83 | int huser_get_account_flags(huser*); | |
84 | ||
3a839281 | 85 | const char *huser_get_nick(huser *); |
86 | const char *huser_get_ident(huser *); | |
87 | const char *huser_get_host(huser *); | |
88 | const char *huser_get_auth(huser *); | |
89 | const char *huser_get_realname(huser *); | |
90 | ||
c86edd1d Q |
91 | /* defines the "being on queue" and being on desk (getting service) */ |
92 | int on_queue(huser*, huser_channel*); | |
93 | int on_desk(huser*, huser_channel*); | |
94 | ||
95 | /* trojan removal */ | |
96 | int huser_is_trojan(huser*); | |
97 | ||
98 | huser_channel *huser_add_channel(huser*, struct hchannel_struct*); | |
99 | void huser_del_channel(huser*, struct hchannel_struct*); | |
100 | /* returns 0 if the user is not on the channel, non-zero otherwise */ | |
101 | huser_channel *huser_on_channel(huser*, struct hchannel_struct*); | |
102 | ||
103 | /* returns non-zero if the given huser pointer is valid */ | |
104 | int huser_valid(huser*); | |
105 | ||
106 | #endif |