]> jfr.im git - irc/rqf/shadowircd.git/blob - extensions/sno_globalkline.c
Disallow mIRC italics in channel names when disable_fake_channels
[irc/rqf/shadowircd.git] / extensions / sno_globalkline.c
1 /*
2 * Shows notices if remote clients exit with "Bad user info" or
3 * ConfigFileEntry.kline_reason.
4 * Assumes client_exit is enabled so users can't fake these reasons,
5 * and kline_reason is enabled and the same everywhere.
6 * Yes, this is a hack, but it is simple and avoids sending
7 * more data across servers -- jilles
8 *
9 */
10
11 #include "stdinc.h"
12 #include "modules.h"
13 #include "client.h"
14 #include "hook.h"
15 #include "ircd.h"
16 #include "send.h"
17 #include "s_conf.h"
18
19 static void h_gla_client_exit(hook_data_client_exit *);
20
21 mapi_hfn_list_av1 gla_hfnlist[] = {
22 { "client_exit", (hookfn) h_gla_client_exit },
23 { NULL, NULL }
24 };
25
26 DECLARE_MODULE_AV1(globallineactive, NULL, NULL, NULL, NULL, gla_hfnlist, "$Revision: 613 $");
27
28 static void
29 h_gla_client_exit(hook_data_client_exit *hdata)
30 {
31 struct Client *source_p;
32
33 source_p = hdata->target;
34
35 if (MyConnect(source_p) || !IsClient(source_p))
36 return;
37 if (!strcmp(hdata->comment, "Bad user info"))
38 {
39 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
40 "XLINE active for %s[%s@%s]",
41 source_p->name, source_p->username, source_p->host);
42 }
43 else if (ConfigFileEntry.kline_reason != NULL &&
44 !strcmp(hdata->comment, ConfigFileEntry.kline_reason))
45 {
46 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
47 "K/DLINE active for %s[%s@%s]",
48 source_p->name, source_p->username, source_p->host);
49 }
50 else if (!strncmp(hdata->comment, "Temporary K-line ", 17))
51 {
52 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
53 "K/DLINE active for %s[%s@%s]",
54 source_p->name, source_p->username, source_p->host);
55 }
56 else if (!strncmp(hdata->comment, "Temporary D-line ", 17))
57 {
58 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
59 "K/DLINE active for %s[%s@%s]",
60 source_p->name, source_p->username, source_p->host);
61 }
62 }