]> jfr.im git - solanum.git/blobdiff - modules/m_unreject.c
ircd/packet.c: make function definition consistent with declaration (#301)
[solanum.git] / modules / m_unreject.c
index 7b333e8e6f2e8b58e32e82b41ed1b24cd3607563..9bed1b1ed5d82b8d4fd5e5abf9791a52346da280 100644 (file)
@@ -19,8 +19,6 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
- *
- *  $Id: m_unreject.c 254 2005-09-21 23:35:12Z nenolod $
  */
 
 #include "stdinc.h"
 #include "modules.h"
 #include "send.h"
 
-static int mo_unreject(struct Client *, struct Client *, int, const char **);
+static const char unreject_desc[] =
+       "Provides the UNREJECT command to remove an IP from the reject cache";
+
+static void mo_unreject(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message unreject_msgtab = {
-       "UNREJECT", 0, 0, 0, MFLG_SLOW,
+       "UNREJECT", 0, 0, 0, 0,
        {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_unreject, 2}}
 };
 
 mapi_clist_av1 unreject_clist[] = { &unreject_msgtab, NULL };
-DECLARE_MODULE_AV1(unreject, NULL, NULL, unreject_clist, NULL, NULL, "$Revision: 254 $");
+
+DECLARE_MODULE_AV2(unreject, NULL, NULL, unreject_clist, NULL, NULL, NULL, NULL, unreject_desc);
 
 /*
  * mo_unreject
- *
  */
-static int
-mo_unreject(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static void
+mo_unreject(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(ConfigFileEntry.reject_after_count == 0 || ConfigFileEntry.reject_ban_time == 0 ||
           ConfigFileEntry.reject_duration == 0)
        {
-               sendto_one(source_p, ":%s NOTICE %s :Reject cache is disabled",
-                          me.name, source_p->name);
-               return 0;                       
+               sendto_one_notice(source_p, ":Reject cache is disabled");
+               return;
        }
 
        if(!parse_netmask(parv[1], NULL, NULL))
        {
-               sendto_one(source_p, ":%s NOTICE %s :Unable to parse netmask %s", 
-                          me.name, source_p->name, parv[1]);
-               return 0;
-       }       
-       
-       if(remove_reject(parv[1]))
-               sendto_one(source_p, ":%s NOTICE %s :Removed reject for %s", 
-                          me.name, source_p->name, parv[1]);
+               sendto_one_notice(source_p, ":Unable to parse netmask %s", parv[1]);
+               return;
+       }
+
+       if(remove_reject_ip(parv[1]))
+               sendto_one_notice(source_p, ":Removed reject for %s", parv[1]);
        else
-               sendto_one(source_p, ":%s NOTICE %s :Unable to remove reject for %s",
-                          me.name, source_p->name, parv[1]);
-       return 0;
+               sendto_one_notice(source_p, ":Unable to remove reject for %s", parv[1]);
 }