]> jfr.im git - irc/quakenet/newserv.git/blame - helpmod2/huser.h
Disable kill.
[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
9af95c3d 14#include "hed.h"
c86edd1d
Q
15#include "helpmod_entries.h"
16
17#define H_USRFLAGS_DEFAULT 0
18
19typedef 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
47enum
48{
49 HCUMODE_OP = 1 << 0,
50 HCUMODE_VOICE = 1 << 1,
51 HQUEUE_DONE = 1 << 2,
52 H_IDLE_WARNING = 1 << 3
53};
54
55typedef 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
68extern huser *husers;
69
70huser *huser_add(nick*);
71void huser_del(huser*);
72void huser_del_all();
73huser *huser_get(nick*);
74
75/* indicates that the user did something, channel is optional */
76void huser_activity(huser*, hchannel *);
77
78void huser_clear_inactives(void);
79int huser_count(void);
80void huser_reset_states(void);
81
82hlevel huser_get_level(huser*);
83int huser_get_account_flags(huser*);
84
3a839281 85const char *huser_get_nick(huser *);
86const char *huser_get_ident(huser *);
87const char *huser_get_host(huser *);
88const char *huser_get_auth(huser *);
89const char *huser_get_realname(huser *);
90
c86edd1d
Q
91/* defines the "being on queue" and being on desk (getting service) */
92int on_queue(huser*, huser_channel*);
93int on_desk(huser*, huser_channel*);
94
95/* trojan removal */
96int huser_is_trojan(huser*);
97
98huser_channel *huser_add_channel(huser*, struct hchannel_struct*);
99void huser_del_channel(huser*, struct hchannel_struct*);
100/* returns 0 if the user is not on the channel, non-zero otherwise */
101huser_channel *huser_on_channel(huser*, struct hchannel_struct*);
102
103/* returns non-zero if the given huser pointer is valid */
104int huser_valid(huser*);
105
106#endif