solanum/extensions/sno_globalnickchange.c

48 lines
1 KiB
C
Raw Normal View History

/*
* Remote client nick change notices.
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "snomask.h"
static const char sno_desc[] =
"Adds server notices for remote nick changes";
static int _modinit(void);
2021-08-20 03:09:40 +00:00
static void h_gnc_nick_change(void *data);
mapi_hfn_list_av1 gcn_hfnlist[] = {
2021-08-20 03:09:40 +00:00
{ "remote_nick_change", h_gnc_nick_change },
{ NULL, NULL }
};
DECLARE_MODULE_AV2(globalnickchange, _modinit, NULL, NULL, NULL, gcn_hfnlist, NULL, NULL, sno_desc);
static int
_modinit(void)
{
/* show the fact that we are showing user information in /version */
2016-03-09 08:19:31 +00:00
opers_see_all_users = true;
return 0;
}
static void
2021-08-20 03:09:40 +00:00
h_gnc_nick_change(void *data_)
{
2021-08-20 03:09:40 +00:00
hook_data *data = data_;
struct Client *source_p = data->client;
const char *oldnick = data->arg1;
const char *newnick = data->arg2;
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);
}