]> jfr.im git - solanum.git/blobdiff - modules/m_cmessage.c
modules: chase MsgBuf API change
[solanum.git] / modules / m_cmessage.c
index 5d38265623009a66c9a281e69a542cf1d19186b0..7edb392946adee35ded5dd476b97a631f3ec3924 100644 (file)
 #include "send.h"
 #include "s_conf.h"
 #include "packet.h"
+#include "supported.h"
 
-static int m_cmessage(int, const char *, struct Client *, struct Client *, int, const char **);
-static int m_cprivmsg(struct Client *, struct Client *, int, const char **);
-static int m_cnotice(struct Client *, struct Client *, int, const char **);
+static int m_cmessage(int, const char *, struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int m_cprivmsg(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static int m_cnotice(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+
+static int
+_modinit(void)
+{
+       add_isupport("CPRIVMSG", isupport_string, "");
+       add_isupport("CNOTICE", isupport_string, "");
+
+       return 0;
+}
+
+static void
+_moddeinit(void)
+{
+       delete_isupport("CPRIVMSG");
+       delete_isupport("CNOTICE");
+}
 
 struct Message cprivmsg_msgtab = {
        "CPRIVMSG", 0, 0, 0, MFLG_SLOW,
@@ -57,25 +74,25 @@ struct Message cnotice_msgtab = {
 };
 
 mapi_clist_av1 cmessage_clist[] = { &cprivmsg_msgtab, &cnotice_msgtab, NULL };
-DECLARE_MODULE_AV1(cmessage, NULL, NULL, cmessage_clist, NULL, NULL, "$Revision: 1543 $");
+DECLARE_MODULE_AV1(cmessage, _modinit, _moddeinit, cmessage_clist, NULL, NULL, "$Revision: 1543 $");
 
 #define PRIVMSG 0
 #define NOTICE 1
 
 static int
-m_cprivmsg(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_cprivmsg(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
-       return m_cmessage(PRIVMSG, "PRIVMSG", client_p, source_p, parc, parv);
+       return m_cmessage(PRIVMSG, "PRIVMSG", msgbuf_p, client_p, source_p, parc, parv);
 }
 
 static int
-m_cnotice(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_cnotice(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
-       return m_cmessage(NOTICE, "NOTICE", client_p, source_p, parc, parv);
+       return m_cmessage(NOTICE, "NOTICE", msgbuf_p, client_p, source_p, parc, parv);
 }
 
 static int
-m_cmessage(int p_or_n, const char *command,
+m_cmessage(int p_or_n, const char *command, struct MsgBuf *msgbuf_p,
                struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Client *target_p;