]>
Commit | Line | Data |
---|---|---|
88c48be5 AC |
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 | ||
eeabf33a EM |
14 | static const char sno_desc[] = |
15 | "Adds server notices for remote nick changes"; | |
16 | ||
88c48be5 | 17 | static int _modinit(void); |
82436efb | 18 | static void h_gnc_nick_change(void *data); |
88c48be5 AC |
19 | |
20 | mapi_hfn_list_av1 gcn_hfnlist[] = { | |
82436efb | 21 | { "remote_nick_change", h_gnc_nick_change }, |
88c48be5 AC |
22 | { NULL, NULL } |
23 | }; | |
24 | ||
84b4c058 | 25 | DECLARE_MODULE_AV2(globalnickchange, _modinit, NULL, NULL, NULL, gcn_hfnlist, NULL, NULL, sno_desc); |
88c48be5 AC |
26 | |
27 | static int | |
28 | _modinit(void) | |
29 | { | |
30 | /* show the fact that we are showing user information in /version */ | |
503727d1 | 31 | opers_see_all_users = true; |
88c48be5 AC |
32 | |
33 | return 0; | |
34 | } | |
35 | ||
36 | static void | |
82436efb | 37 | h_gnc_nick_change(void *data_) |
88c48be5 | 38 | { |
82436efb | 39 | hook_data *data = data_; |
88c48be5 AC |
40 | struct Client *source_p = data->client; |
41 | const char *oldnick = data->arg1; | |
42 | const char *newnick = data->arg2; | |
43 | ||
44 | sendto_realops_snomask_from(SNO_NCHANGE, L_ALL, source_p->servptr, | |
45 | "Nick change: From %s to %s [%s@%s]", | |
46 | oldnick, newnick, source_p->username, source_p->host); | |
47 | } |