2016-01-12 14:10:39 +01:00
|
|
|
/*
|
|
|
|
* Remote client nick change notices.
|
|
|
|
*/
|
|
|
|
|
2016-08-13 05:05:54 +02:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 08:29:41 +01:00
|
|
|
static const char sno_desc[] =
|
|
|
|
"Adds server notices for remote nick changes";
|
|
|
|
|
2016-01-12 14:10:39 +01:00
|
|
|
static int _modinit(void);
|
|
|
|
static void h_gnc_nick_change(hook_data *data);
|
|
|
|
|
|
|
|
mapi_hfn_list_av1 gcn_hfnlist[] = {
|
|
|
|
{ "remote_nick_change", (hookfn) h_gnc_nick_change },
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2016-03-07 11:02:27 +01:00
|
|
|
DECLARE_MODULE_AV2(globalnickchange, _modinit, NULL, NULL, NULL, gcn_hfnlist, NULL, NULL, sno_desc);
|
2016-01-12 14:10:39 +01:00
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
|
|
|
/* show the fact that we are showing user information in /version */
|
2016-03-09 09:19:31 +01:00
|
|
|
opers_see_all_users = true;
|
2016-01-12 14:10:39 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
h_gnc_nick_change(hook_data *data)
|
|
|
|
{
|
|
|
|
struct Client *source_p = data->client;
|
2016-07-13 07:17:21 +02:00
|
|
|
const char *oldnick = (const char *)data->arg1;
|
|
|
|
const char *newnick = (const char *)data->arg2;
|
2016-01-12 14:10:39 +01:00
|
|
|
|
|
|
|
sendto_realops_snomask_from(SNO_NCHANGE, L_ALL, source_p->servptr,
|
|
|
|
"Nick change: From %s to %s [%s@%s]",
|
|
|
|
oldnick, newnick, source_p->username, source_p->host);
|
|
|
|
}
|