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
18 static const char sno_desc
[] =
19 "Adds server notices for global XLINEs, KLINEs, and DLINEs";
21 static void h_gla_client_exit(hook_data_client_exit
*);
23 mapi_hfn_list_av1 gla_hfnlist
[] = {
24 { "client_exit", (hookfn
) h_gla_client_exit
},
28 DECLARE_MODULE_AV2(globallineactive
, NULL
, NULL
, NULL
, NULL
, gla_hfnlist
, NULL
, NULL
, sno_desc
);
31 h_gla_client_exit(hook_data_client_exit
*hdata
)
33 struct Client
*source_p
;
35 source_p
= hdata
->target
;
37 if (MyConnect(source_p
) || !IsClient(source_p
))
39 if (!strcmp(hdata
->comment
, "Bad user info"))
41 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
42 "XLINE active for %s[%s@%s]",
43 source_p
->name
, source_p
->username
, source_p
->host
);
45 else if (ConfigFileEntry
.kline_reason
!= NULL
&&
46 !strcmp(hdata
->comment
, ConfigFileEntry
.kline_reason
))
48 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
49 "K/DLINE active for %s[%s@%s]",
50 source_p
->name
, source_p
->username
, source_p
->host
);
52 else if (!strncmp(hdata
->comment
, "Temporary K-line ", 17))
54 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
55 "K/DLINE active for %s[%s@%s]",
56 source_p
->name
, source_p
->username
, source_p
->host
);
58 else if (!strncmp(hdata
->comment
, "Temporary D-line ", 17))
60 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
61 "K/DLINE active for %s[%s@%s]",
62 source_p
->name
, source_p
->username
, source_p
->host
);