0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-19 08:21:09 +01:00
construct/extensions/sno_globaloper.cc

33 lines
847 B
C++
Raw Normal View History

/*
* Remote oper up notices.
*/
2016-08-13 05:05:54 +02:00
using namespace ircd;
static const char sno_desc[] =
"Adds server notices for remote oper up";
static void h_sgo_umode_changed(void *);
mapi_hfn_list_av1 sgo_hfnlist[] = {
{ "umode_changed", (hookfn) h_sgo_umode_changed },
{ NULL, NULL }
};
DECLARE_MODULE_AV2(sno_globaloper, NULL, NULL, NULL, NULL, sgo_hfnlist, NULL, NULL, sno_desc);
static void
h_sgo_umode_changed(void *vdata)
{
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
client::client *source_p = data->client;
2016-08-23 04:33:36 +02:00
if (my_connect(*source_p) || !has_sent_eob(*source_p->servptr))
return;
2016-08-24 00:25:09 +02:00
if (!(data->oldumodes & umode::OPER) && is(*source_p, umode::OPER))
2016-08-26 13:50:12 +02:00
sendto_realops_snomask_from(sno::GENERAL, L_ALL, source_p->servptr,
"%s (%s@%s) is now an operator",
source_p->name, source_p->username, source_p->host);
}