/*
- * charybdis: an advanced ircd.
+ * Solanum: a slightly advanced ircd
* chm_nonotice: block NOTICEs (+T mode).
*
- * Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org>
+ * Copyright (c) 2012 Ariadne Conill <ariadne@dereferenced.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
+#include "messages.h"
#include "inline/stringops.h"
+static const char chm_nonotice_desc[] =
+ "Adds channel mode +T which blocks notices to the channel.";
+
static unsigned int mode_nonotice;
-static void chm_nonotice_process(hook_data_privmsg_channel *);
+static void chm_nonotice_process(void *);
mapi_hfn_list_av1 chm_nonotice_hfnlist[] = {
- { "privmsg_channel", (hookfn) chm_nonotice_process },
+ { "privmsg_channel", chm_nonotice_process },
{ NULL, NULL }
};
static void
-chm_nonotice_process(hook_data_privmsg_channel *data)
+chm_nonotice_process(void *data_)
{
+ hook_data_privmsg_channel *data = data_;
+
/* don't waste CPU if message is already blocked */
if (data->approved || data->msgtype != MESSAGE_TYPE_NOTICE)
return;
cflag_orphan('T');
}
-DECLARE_MODULE_AV1(chm_nonotice, _modinit, _moddeinit, NULL, NULL, chm_nonotice_hfnlist, "$Revision$");
+DECLARE_MODULE_AV2(chm_nonotice, _modinit, _moddeinit, NULL, NULL, chm_nonotice_hfnlist, NULL, NULL, chm_nonotice_desc);