]> jfr.im git - solanum.git/blobdiff - modules/core/m_mode.c
modules: chase MsgBuf API change
[solanum.git] / modules / core / m_mode.c
index f8fee2ec818a235c3d1348d22d295405ea2ec671..355e382a560641b2920be63331165ee3cb7287d6 100644 (file)
 #include "packet.h"
 #include "s_newconf.h"
 
-static int m_mode(struct Client *, struct Client *, int, const char **);
-static int ms_mode(struct Client *, struct Client *, int, const char **);
-static int ms_tmode(struct Client *, struct Client *, int, const char **);
-static int ms_mlock(struct Client *, struct Client *, int, const char **);
-static int ms_bmask(struct Client *, struct Client *, int, const char **);
+static int m_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int ms_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int ms_tmode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int ms_mlock(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int ms_bmask(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message mode_msgtab = {
        "MODE", 0, 0, 0, MFLG_SLOW,
@@ -74,7 +74,7 @@ DECLARE_MODULE_AV1(mode, NULL, NULL, mode_clist, NULL, NULL, "$Revision: 1006 $"
  * parv[1] - channel
  */
 static int
-m_mode(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_mode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Channel *chptr = NULL;
        struct membership *msptr;
@@ -140,7 +140,7 @@ m_mode(struct Client *client_p, struct Client *source_p, int parc, const char *p
                /* Finish the flood grace period... */
                if(MyClient(source_p) && !IsFloodDone(source_p))
                {
-                       if(!((parc == 3) && (parv[2][0] == 'b') && (parv[2][1] == '\0')))
+                       if(!((parc == 3) && (parv[2][0] == 'b' || parv[2][0] == 'q') && (parv[2][1] == '\0')))
                                flood_endgrace(source_p);
                }
 
@@ -151,7 +151,7 @@ m_mode(struct Client *client_p, struct Client *source_p, int parc, const char *p
 }
 
 static int
-ms_mode(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_mode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Channel *chptr;
 
@@ -170,7 +170,7 @@ ms_mode(struct Client *client_p, struct Client *source_p, int parc, const char *
 }
 
 static int
-ms_tmode(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_tmode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Channel *chptr = NULL;
        struct membership *msptr;
@@ -210,7 +210,7 @@ ms_tmode(struct Client *client_p, struct Client *source_p, int parc, const char
 }
 
 static int
-ms_mlock(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_mlock(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Channel *chptr = NULL;
 
@@ -270,7 +270,7 @@ possibly_remove_lower_forward(struct Client *fakesource_p, int mems,
 }
 
 static int
-ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_bmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static char modebuf[BUFSIZE];
        static char parabuf[BUFSIZE];
@@ -341,7 +341,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
                fakesource_p = &me;
        else
                fakesource_p = source_p;
-       mlen = rb_sprintf(modebuf, ":%s MODE %s +", fakesource_p->name, chptr->chname);
+       mlen = sprintf(modebuf, ":%s MODE %s +", fakesource_p->name, chptr->chname);
        mbuf = modebuf + mlen;
        pbuf = parabuf;
 
@@ -401,7 +401,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
                                forward[-1] = '$';
 
                        *mbuf++ = parv[3][0];
-                       arglen = rb_sprintf(pbuf, "%s ", s);
+                       arglen = sprintf(pbuf, "%s ", s);
                        pbuf += arglen;
                        plen += arglen;
                        modecount++;
@@ -433,4 +433,3 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
                      source_p->id, (long) chptr->channelts, chptr->chname, parv[3], parv[4]);
        return 0;
 }
-