0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 18:18:35 +02:00
construct/extensions/sno_globalnickchange.cc
Jason Volk 61b517ca3c Precompile and remove most include directives. Notes:
* To benefit from the precompiled-header (PCH) it MUST provide "the first C token."

Advantages:
Never worry about the include stack again. Remember, this means one less thing
for random module developers, community people learning C++, and new developers
to deal with. It should reduce the learning curve and barrier for participation.

Disadvantages:
Makes overall compilation a bit slower, especially without any additional
work to improve it again. There are several opportunities, places where the
PCH is probably being ignored, etc that can be addressed.
2016-08-20 19:30:33 -07:00

40 lines
940 B
C++

/*
* Remote client nick change notices.
*/
using namespace ircd;
static const char sno_desc[] =
"Adds server notices for remote nick changes";
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 }
};
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 */
opers_see_all_users = true;
return 0;
}
static void
h_gnc_nick_change(hook_data *data)
{
struct Client *source_p = data->client;
const char *oldnick = (const char *)data->arg1;
const char *newnick = (const char *)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);
}