]> jfr.im git - irc/rqf/shadowircd.git/blob - extensions/sno_globaloper.c
Added tag shadowircd-6.3.0 for changeset 031bedf7e340
[irc/rqf/shadowircd.git] / extensions / sno_globaloper.c
1 /*
2 * Remote oper up notices.
3 *
4 */
5
6 #include "stdinc.h"
7 #include "modules.h"
8 #include "client.h"
9 #include "hook.h"
10 #include "ircd.h"
11 #include "send.h"
12 #include "s_conf.h"
13 #include "snomask.h"
14
15 static void h_sgo_umode_changed(void *);
16
17 mapi_hfn_list_av1 sgo_hfnlist[] = {
18 { "umode_changed", (hookfn) h_sgo_umode_changed },
19 { NULL, NULL }
20 };
21
22 DECLARE_MODULE_AV1(sno_globaloper, NULL, NULL, NULL, NULL, sgo_hfnlist, "$Revision: 639 $");
23
24 static void
25 h_sgo_umode_changed(void *vdata)
26 {
27 hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
28 struct Client *source_p = data->client;
29
30 if (MyConnect(source_p) || !HasSentEob(source_p->servptr))
31 return;
32
33 if (!(data->oldumodes & UMODE_OPER) && IsOper(source_p))
34 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
35 "%s (%s@%s) is now an operator",
36 source_p->name, source_p->username, source_p->host);
37 }