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