*
* 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"
/* }}} */
/* {{{ 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);
static int heal_nick(struct Client *, struct Client *);
-static int nick_is_valid(const char *);
/* }}} */
/* {{{ State containers */
/* {{{ 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}
}
hurt_clist,
NULL,
hurt_hfnlist,
- "$Revision: 3161 $"
+ NULL
);
/* }}} */
* 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;
* 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;
* 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;
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)
/* }}} */
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;
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))
}
/* }}} */
-/*
- * 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
*/