]> jfr.im git - solanum.git/blob - extensions/sno_globalnickchange.c
dd01d8f6c228d8d17397b210892f4583314e26e6
[solanum.git] / extensions / sno_globalnickchange.c
1 /*
2 * Remote client nick change notices.
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 int _modinit(void);
15 static void h_gnc_nick_change(hook_data *data);
16
17 mapi_hfn_list_av1 gcn_hfnlist[] = {
18 { "remote_nick_change", (hookfn) h_gnc_nick_change },
19 { NULL, NULL }
20 };
21
22 DECLARE_MODULE_AV1(globalnickchange, _modinit, NULL, NULL, NULL, gcn_hfnlist, "$Revision: 1869 $");
23
24 static int
25 _modinit(void)
26 {
27 /* show the fact that we are showing user information in /version */
28 opers_see_all_users = 1;
29
30 return 0;
31 }
32
33 static void
34 h_gnc_nick_change(hook_data *data)
35 {
36 struct Client *source_p = data->client;
37 const char *oldnick = data->arg1;
38 const char *newnick = data->arg2;
39
40 sendto_realops_snomask_from(SNO_NCHANGE, L_ALL, source_p->servptr,
41 "Nick change: From %s to %s [%s@%s]",
42 oldnick, newnick, source_p->username, source_p->host);
43 }