2007-01-25 06:40:21 +00:00
|
|
|
/*
|
|
|
|
* Remote oper up 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"
|
|
|
|
|
2016-03-09 07:29:41 +00:00
|
|
|
static const char sno_desc[] =
|
|
|
|
"Adds server notices for remote oper up";
|
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
static void h_sgo_umode_changed(void *);
|
|
|
|
|
|
|
|
mapi_hfn_list_av1 sgo_hfnlist[] = {
|
2021-08-20 03:09:40 +00:00
|
|
|
{ "umode_changed", h_sgo_umode_changed },
|
2007-01-25 06:40:21 +00:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2016-03-07 10:02:27 +00:00
|
|
|
DECLARE_MODULE_AV2(sno_globaloper, NULL, NULL, NULL, NULL, sgo_hfnlist, NULL, NULL, sno_desc);
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
h_sgo_umode_changed(void *vdata)
|
|
|
|
{
|
|
|
|
hook_data_umode_changed *data = (hook_data_umode_changed *)vdata;
|
|
|
|
struct Client *source_p = data->client;
|
|
|
|
|
|
|
|
if (MyConnect(source_p) || !HasSentEob(source_p->servptr))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!(data->oldumodes & UMODE_OPER) && IsOper(source_p))
|
|
|
|
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);
|
|
|
|
}
|