]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_mode.c
mode api: Remove most modes from the chmode_table, and have them initialized in modes...
[irc/rqf/shadowircd.git] / modules / core / m_mode.c
index 4867e4498e567efe4e35a3b13d3a0aa7fc1c75c5..759a71d0eaf53b6fc24d1eb6f7825a174cb7cc2f 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_mode.c 1006 2006-03-09 15:32:14Z nenolod $
  */
 
 #include "stdinc.h"
-#include "tools.h"
-#include "balloc.h"
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
-#include "irc_string.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "s_user.h"
 #include "s_conf.h"
 #include "s_serv.h"
-#include "s_log.h"
+#include "logger.h"
 #include "send.h"
 #include "msg.h"
 #include "parse.h"
 #include "modules.h"
 #include "packet.h"
-#include "sprintf_irc.h"
 #include "s_newconf.h"
 
+struct module_modes ModuleModes;
+
 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 **);
@@ -69,7 +67,6 @@ DECLARE_MODULE_AV1(mode, NULL, NULL, mode_clist, NULL, NULL, "$Revision: 1006 $"
 
 /*
  * m_mode - MODE command handler
- * parv[0] - sender
  * parv[1] - channel
  */
 static int
@@ -214,7 +211,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
        static char modebuf[BUFSIZE];
        static char parabuf[BUFSIZE];
        struct Channel *chptr;
-       dlink_list *banlist;
+       rb_dlink_list *banlist;
        const char *s;
        char *t;
        char *mbuf;
@@ -263,7 +260,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
 
        case 'q':
                banlist = &chptr->quietlist;
-               mode_type = CHFL_QUIET;
+               mode_type = ModuleModes.CHFL_QUIET;
                mems = ALL_MEMBERS;
                break;
 
@@ -280,7 +277,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
                fakesource_p = &me;
        else
                fakesource_p = source_p;
-       mlen = ircsprintf(modebuf, ":%s MODE %s +", fakesource_p->name, chptr->chname);
+       mlen = rb_sprintf(modebuf, ":%s MODE %s +", fakesource_p->name, chptr->chname);
        mbuf = modebuf + mlen;
        pbuf = parabuf;
 
@@ -328,7 +325,7 @@ ms_bmask(struct Client *client_p, struct Client *source_p, int parc, const char
                        }
 
                        *mbuf++ = parv[3][0];
-                       arglen = ircsprintf(pbuf, "%s ", s);
+                       arglen = rb_sprintf(pbuf, "%s ", s);
                        pbuf += arglen;
                        plen += arglen;
                        modecount++;