]>
Commit | Line | Data |
---|---|---|
0e4a6199 JH |
1 | #include "stdinc.h" |
2 | #include "modules.h" | |
3 | #include "hook.h" | |
4 | #include "client.h" | |
5 | #include "ircd.h" | |
6 | #include "send.h" | |
7 | #include "numeric.h" | |
8 | #include "chmode.h" | |
9 | #include "s_newconf.h" | |
10 | ||
11 | static void can_kick(hook_data_channel_approval *); | |
12 | ||
13 | mapi_hfn_list_av1 nooperkick_hfnlist[] = { | |
14 | { "can_kick", (hookfn) can_kick }, | |
15 | { NULL, NULL } | |
16 | }; | |
17 | ||
18 | DECLARE_MODULE_AV1(chm_no_oper_kick, NULL, NULL, NULL, NULL, nooperkick_hfnlist, "$Revision$"); | |
19 | ||
20 | static void | |
21 | can_kick(hook_data_channel_approval *data) | |
22 | { | |
23 | struct Client *source_p = data->client; | |
24 | struct Client *target_p = data->target; | |
25 | struct Channel *chptr = data->chptr; | |
26 | ||
27 | if (target_p->umodes & UMODE_OVERRIDE && data->approved) | |
28 | { | |
29 | sendto_one_numeric(source_p, ERR_ISCHANSERVICE, | |
30 | "%s %s :User is immune from kick.", | |
31 | target_p->name, chptr->chname); | |
32 | sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Overriding KICK from %s on %s in %s (user is immune)", | |
33 | source_p->name, target_p->name, chptr->chname); | |
34 | data->approved = 0; | |
35 | } | |
36 | } |