]> jfr.im git - solanum.git/blobdiff - modules/m_pong.c
m_chghost: convert more stuff to bool [ci skip]
[solanum.git] / modules / m_pong.c
index 9de629d3359e1a39b84f5791a34371ec6f8f80b6..a727fcf5ccd577cb1d83e1a1c5c3ec1a00071bea 100644 (file)
@@ -20,8 +20,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_pong.c 3181 2007-02-01 00:49:07Z jilles $
  */
 
 #include "stdinc.h"
 #include "hash.h"
 #include "modules.h"
 
-static int mr_pong(struct Client *, struct Client *, int, const char **);
-static int ms_pong(struct Client *, struct Client *, int, const char **);
+static const char pong_desc[] = "Provides the PONG command to respond to a PING message";
+
+static void mr_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message pong_msgtab = {
-       "PONG", 0, 0, 0, MFLG_SLOW | MFLG_UNREG,
+       "PONG", 0, 0, 0, 0,
        {{mr_pong, 0}, mg_ignore, mg_ignore, {ms_pong, 2}, mg_ignore, mg_ignore}
 };
 
 mapi_clist_av1 pong_clist[] = { &pong_msgtab, NULL };
-DECLARE_MODULE_AV1(pong, NULL, NULL, pong_clist, NULL, NULL, "$Revision: 3181 $");
 
-static int
-ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+DECLARE_MODULE_AV2(pong, NULL, NULL, pong_clist, NULL, NULL, NULL, NULL, pong_desc);
+
+static void
+ms_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Client *target_p;
        const char *destination;
@@ -78,7 +79,7 @@ ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char *
                        if(!IsDigit(*destination))
                                sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
                                                   form_str(ERR_NOSUCHSERVER), destination);
-                       return 0;
+                       return;
                }
        }
 
@@ -94,12 +95,10 @@ ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char *
                eob_count++;
                call_hook(h_server_eob, source_p);
        }
-
-       return 0;
 }
 
-static int
-mr_pong(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static void
+mr_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(parc == 2 && !EmptyString(parv[1]))
        {
@@ -118,7 +117,7 @@ mr_pong(struct Client *client_p, struct Client *source_p, int parc, const char *
                                        sendto_one(source_p, form_str(ERR_WRONGPONG),
                                                   me.name, source_p->name,
                                                   source_p->localClient->random_ping);
-                                       return 0;
+                                       return;
                                }
                        }
                }
@@ -128,6 +127,4 @@ mr_pong(struct Client *client_p, struct Client *source_p, int parc, const char *
                sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, source_p->name);
 
        source_p->flags &= ~FLAGS_PINGSENT;
-
-       return 0;
 }