diff --git a/extensions/Makefile.in b/extensions/Makefile.in index 4f97fb9..f9e75aa 100644 --- a/extensions/Makefile.in +++ b/extensions/Makefile.in @@ -54,6 +54,7 @@ SRCS = \ m_omode.c \ m_opme.c \ m_webirc.c \ + no_locops.c \ no_oper_invis.c \ spy_admin_notice.c \ spy_info_notice.c \ diff --git a/extensions/no_locops.c b/extensions/no_locops.c new file mode 100644 index 0000000..e71b924 --- /dev/null +++ b/extensions/no_locops.c @@ -0,0 +1,33 @@ +/* + * Disable LOCOPS (by disallowing any local user setting +l). + * -- jilles + */ + +#include "stdinc.h" +#include "modules.h" +#include "client.h" +#include "hook.h" +#include "ircd.h" +#include "send.h" +#include "s_conf.h" +#include "s_newconf.h" + +static void h_nl_umode_changed(hook_data_umode_changed *); + +mapi_hfn_list_av1 nl_hfnlist[] = { + { "umode_changed", (hookfn) h_nl_umode_changed }, + { NULL, NULL } +}; + +DECLARE_MODULE_AV1(no_locops, NULL, NULL, NULL, NULL, nl_hfnlist, "$Revision: 3219 $"); + +static void +h_nl_umode_changed(hook_data_umode_changed *hdata) +{ + struct Client *source_p = hdata->client; + + if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS) + { + source_p->umodes &= ~UMODE_LOCOPS; + } +}