2 * Remote client connect/exit notices on snomask +F (far).
3 * To avoid flooding, connects/exits part of netjoins/netsplits are not shown.
4 * Consequently, it is not possible to use these notices to keep track
18 static const char sno_desc
[] =
19 "Adds server notice mask +F that allows operators to receive notices for connections on other servers";
21 static int _modinit(void);
22 static void _moddeinit(void);
23 static void h_gcn_new_remote_user(void *);
24 static void h_gcn_client_exit(void *);
26 mapi_hfn_list_av1 gcn_hfnlist
[] = {
27 { "new_remote_user", h_gcn_new_remote_user
},
28 { "client_exit", h_gcn_client_exit
},
32 DECLARE_MODULE_AV2(globalconnexit
, _modinit
, _moddeinit
, NULL
, NULL
, gcn_hfnlist
, NULL
, NULL
, sno_desc
);
37 /* add the snomask to the available slot */
38 snomask_modes
['F'] = find_snomask_slot();
40 /* show the fact that we are showing user information in /version */
41 opers_see_all_users
= true;
49 /* disable the snomask and remove it from the available list */
50 snomask_modes
['F'] = 0;
54 h_gcn_new_remote_user(void *data
)
56 struct Client
*source_p
= data
;
58 if (!HasSentEob(source_p
->servptr
))
60 sendto_realops_snomask_from(snomask_modes
['F'], L_ALL
, source_p
->servptr
,
61 "Client connecting: %s (%s@%s) [%s] {%s} <%s> [%s]",
62 source_p
->name
, source_p
->username
, source_p
->orighost
,
63 show_ip(NULL
, source_p
) ? source_p
->sockhost
: "255.255.255.255",
64 "?", *source_p
->user
->suser
? source_p
->user
->suser
: "*",
69 h_gcn_client_exit(void *data
)
71 hook_data_client_exit
*hdata
= data
;
72 struct Client
*source_p
;
74 source_p
= hdata
->target
;
76 if (MyConnect(source_p
) || !IsClient(source_p
))
78 if (!HasSentEob(source_p
->servptr
))
80 sendto_realops_snomask_from(snomask_modes
['F'], L_ALL
, source_p
->servptr
,
81 "Client exiting: %s (%s@%s) [%s] [%s]",
83 source_p
->username
, source_p
->host
, hdata
->comment
,
84 show_ip(NULL
, source_p
) ? source_p
->sockhost
: "255.255.255.255");