]>
Commit | Line | Data |
---|---|---|
212380e3 AC |
1 | /* |
2 | * Remote oper up notices. | |
212380e3 AC |
3 | */ |
4 | ||
5 | #include "stdinc.h" | |
6 | #include "modules.h" | |
7 | #include "client.h" | |
8 | #include "hook.h" | |
9 | #include "ircd.h" | |
10 | #include "send.h" | |
11 | #include "s_conf.h" | |
12 | #include "snomask.h" | |
13 | ||
14 | static void h_sgo_umode_changed(void *); | |
15 | ||
16 | mapi_hfn_list_av1 sgo_hfnlist[] = { | |
17 | { "umode_changed", (hookfn) h_sgo_umode_changed }, | |
18 | { NULL, NULL } | |
19 | }; | |
20 | ||
04f832b7 | 21 | DECLARE_MODULE_AV2(sno_globaloper, NULL, NULL, NULL, NULL, sgo_hfnlist, NULL, NULL, NULL); |
212380e3 AC |
22 | |
23 | static void | |
24 | h_sgo_umode_changed(void *vdata) | |
25 | { | |
26 | hook_data_umode_changed *data = (hook_data_umode_changed *)vdata; | |
27 | struct Client *source_p = data->client; | |
28 | ||
29 | if (MyConnect(source_p) || !HasSentEob(source_p->servptr)) | |
30 | return; | |
31 | ||
32 | if (!(data->oldumodes & UMODE_OPER) && IsOper(source_p)) | |
33 | sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr, | |
34 | "%s (%s@%s) is now an operator", | |
35 | source_p->name, source_p->username, source_p->host); | |
36 | } |