]> jfr.im git - irc/quakenet/newserv.git/blame - helpmod2/huser.h
Added files that weren't in the initial import.
[irc/quakenet/newserv.git] / helpmod2 / huser.h
CommitLineData
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
18typedef 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
44enum
45{
46 HCUMODE_OP = 1 << 0,
47 HCUMODE_VOICE = 1 << 1,
48 HQUEUE_DONE = 1 << 2,
49 H_IDLE_WARNING = 1 << 3
50};
51
52typedef 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
65extern huser *husers;
66
67huser *huser_add(nick*);
68void huser_del(huser*);
69void huser_del_all();
70huser *huser_get(nick*);
71
72/* indicates that the user did something, channel is optional */
73void huser_activity(huser*, hchannel *);
74
75void huser_clear_inactives(void);
76int huser_count(void);
77void huser_reset_states(void);
78
79hlevel huser_get_level(huser*);
80int huser_get_account_flags(huser*);
81
82/* defines the "being on queue" and being on desk (getting service) */
83int on_queue(huser*, huser_channel*);
84int on_desk(huser*, huser_channel*);
85
86/* trojan removal */
87int huser_is_trojan(huser*);
88
89huser_channel *huser_add_channel(huser*, struct hchannel_struct*);
90void huser_del_channel(huser*, struct hchannel_struct*);
91/* returns 0 if the user is not on the channel, non-zero otherwise */
92huser_channel *huser_on_channel(huser*, struct hchannel_struct*);
93
94/* returns non-zero if the given huser pointer is valid */
95int huser_valid(huser*);
96
97#endif