]> jfr.im git - solanum.git/blobdiff - extensions/hurt.c
modules: Add AV2 descriptions to all m_u* modules
[solanum.git] / extensions / hurt.c
index d5e08fe3169cfc632421e52512c1fa1ae6ae1a1a..9181c6ca4eb0ca48f50edb7f18442c37f3f69a5d 100644 (file)
@@ -3,8 +3,6 @@
  *
  * Copyright (C) 2006 charybdis development team
  * All rights reserved
- *
- * $Id: hurt.c 3161 2007-01-25 07:23:01Z nenolod $
  */
 #include "stdinc.h"
 #include "modules.h"
@@ -49,10 +47,10 @@ typedef struct _hurt {
 /* }}} */
 
 /* {{{ Prototypes */
-static int mo_hurt(struct Client *, struct Client *, int, const char **);
-static int me_hurt(struct Client *, struct Client *, int, const char **);
-static int mo_heal(struct Client *, struct Client *, int, const char **);
-static int me_heal(struct Client *, struct Client *, int, const char **);
+static int mo_hurt(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
+static int me_hurt(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
+static int mo_heal(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
+static int me_heal(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **);
 
 static int modinit(void);
 static void modfini(void);
@@ -74,7 +72,6 @@ static void hurt_destroy(void *hurt);
 
 static int heal_nick(struct Client *, struct Client *);
 
-static int nick_is_valid(const char *);
 /* }}} */
 
 /* {{{ State containers */
@@ -85,14 +82,14 @@ rb_dlink_list hurt_confs = { NULL, NULL, 0 };
 
 /* {{{ Messages */
 struct Message hurt_msgtab = {
-       "HURT", 0, 0, 0, MFLG_SLOW, {
+       "HURT", 0, 0, 0, 0, {
                mg_ignore, mg_ignore, mg_ignore,
                mg_ignore, {me_hurt, 0}, {mo_hurt, 3}
        }
 };
 
 struct Message heal_msgtab = {
-       "HEAL", 0, 0, 0, MFLG_SLOW, {
+       "HEAL", 0, 0, 0, 0, {
                mg_ignore, mg_ignore, mg_ignore,
                mg_ignore, {me_heal, 0}, {mo_heal, 2}
        }
@@ -116,7 +113,7 @@ DECLARE_MODULE_AV1(
        hurt_clist,
        NULL,
        hurt_hfnlist,
-       "$Revision: 3161 $"
+       NULL
 );
 /* }}} */
 
@@ -179,7 +176,7 @@ modfini(void)
  * parv[3] - reason or NULL
  */
 static int
-mo_hurt(struct Client *client_p, struct Client *source_p,
+mo_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
                int parc, const char **parv)
 {
        const char                      *ip, *expire, *reason;
@@ -263,7 +260,7 @@ mo_hurt(struct Client *client_p, struct Client *source_p,
  * parv[3] - reason
  */
 static int
-me_hurt(struct Client *client_p, struct Client *source_p,
+me_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
                int parc, const char **parv)
 {
        time_t                          expire_time;
@@ -300,7 +297,7 @@ me_hurt(struct Client *client_p, struct Client *source_p,
  * parv[1] - nick or ip
  */
 static int
-mo_heal(struct Client *client_p, struct Client *source_p,
+mo_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
                int parc, const char **parv)
 {
        struct Client *target_p;
@@ -312,7 +309,7 @@ mo_heal(struct Client *client_p, struct Client *source_p,
                return 0;
        }
 
-       if (nick_is_valid(parv[1]))
+       if (clean_nick(parv[1], 0))
        {
                target_p = find_named_person(parv[1]);
                if (target_p == NULL)
@@ -353,7 +350,7 @@ mo_heal(struct Client *client_p, struct Client *source_p,
 /* }}} */
 
 static int
-me_heal(struct Client *client_p, struct Client *source_p,
+me_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
                int parc, const char **parv)
 {
        struct Client *target_p;
@@ -364,7 +361,7 @@ me_heal(struct Client *client_p, struct Client *source_p,
        if (parc < 2)
                return 0;
 
-       if (nick_is_valid(parv[1]))
+       if (clean_nick(parv[1], 0))
        {
                target_p = find_person(parv[1]);
                if (target_p != NULL && MyConnect(target_p))
@@ -638,25 +635,6 @@ heal_nick(struct Client *source_p, struct Client *target_p)
 }
 /* }}} */
 
-/*
- * Anything else...
- */
-
-/* {{{ static int nick_is_valid() */
-static int
-nick_is_valid(const char *nick)
-{
-       const char *s = nick;
-
-       for (; *s != '\0'; s++) {
-               if (!IsNickChar(*s))
-                       return 0;
-       }
-
-       return 1;
-}
-/* }}} */
-
 /*
  * vim: ts=8 sw=8 noet fdm=marker tw=80
  */