2007-01-25 07:40:21 +01:00
|
|
|
/*
|
|
|
|
* Remote oper up 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 oper up";
|
|
|
|
|
2007-01-25 07:40:21 +01:00
|
|
|
static void h_sgo_umode_changed(void *);
|
|
|
|
|
|
|
|
mapi_hfn_list_av1 sgo_hfnlist[] = {
|
|
|
|
{ "umode_changed", (hookfn) h_sgo_umode_changed },
|
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2016-03-07 11:02:27 +01:00
|
|
|
DECLARE_MODULE_AV2(sno_globaloper, NULL, NULL, NULL, NULL, sgo_hfnlist, NULL, NULL, sno_desc);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
static void
|
|
|
|
h_sgo_umode_changed(void *vdata)
|
|
|
|
{
|
|
|
|
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
2016-08-22 03:57:43 +02:00
|
|
|
client::client *source_p = data->client;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
if (my_connect(*source_p) || !has_sent_eob(*source_p->servptr))
|
2007-01-25 07:40:21 +01:00
|
|
|
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,
|
2007-01-25 07:40:21 +01:00
|
|
|
"%s (%s@%s) is now an operator",
|
|
|
|
source_p->name, source_p->username, source_p->host);
|
|
|
|
}
|