]> jfr.im git - solanum.git/blobdiff - extensions/chm_nonotice.c
explicitly show IP in SNO_BANNED snotes
[solanum.git] / extensions / chm_nonotice.c
index 70ec2c4a21ce1aefbe78b3205542387c355a91f6..f0a4252306e8468717481e1a9e01e2d300bbe8cf 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * 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;
@@ -75,4 +81,4 @@ _moddeinit(void)
        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);