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