#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,
+ "CPRIVMSG", 0, 0, 0, 0,
{mg_ignore, {m_cprivmsg, 4}, mg_ignore, mg_ignore, mg_ignore, {m_cprivmsg, 4}}
};
struct Message cnotice_msgtab = {
- "CNOTICE", 0, 0, 0, MFLG_SLOW,
+ "CNOTICE", 0, 0, 0, 0,
{mg_ignore, {m_cnotice, 4}, mg_ignore, mg_ignore, mg_ignore, {m_cnotice, 4}}
};
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;
{
if(p_or_n != NOTICE)
sendto_one_numeric(source_p, ERR_NOTONCHANNEL,
- form_str(ERR_NOTONCHANNEL),
+ form_str(ERR_NOTONCHANNEL),
chptr->chname);
return 0;
}
form_str(ERR_TARGUMODEG), target_p->name);
if((target_p->localClient->last_caller_id_time +
- ConfigFileEntry.caller_id_wait) < CurrentTime)
+ ConfigFileEntry.caller_id_wait) < rb_current_time())
{
if(p_or_n != NOTICE)
sendto_one_numeric(source_p, RPL_TARGNOTIFY,
me.name, target_p->name, source_p->name,
source_p->username, source_p->host);
- target_p->localClient->last_caller_id_time = CurrentTime;
+ target_p->localClient->last_caller_id_time = rb_current_time();
}
return 0;
}
if(p_or_n != NOTICE)
- source_p->localClient->last = CurrentTime;
+ source_p->localClient->last = rb_current_time();
sendto_anywhere(target_p, source_p, command, ":%s", parv[3]);
return 0;