supported: move ISUPPORT tokens provided by modules to their specific modules:
- m_cmessage: CPRIVMSG/CNOTICE - m_etrace: ETRACE - m_knock: KNOCK - m_services: FNC - m_who: WHOX
This commit is contained in:
parent
d513218a9e
commit
0b904d91bf
6 changed files with 67 additions and 10 deletions
|
@ -42,11 +42,28 @@
|
|||
#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
|
||||
_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,
|
||||
{mg_ignore, {m_cprivmsg, 4}, mg_ignore, mg_ignore, mg_ignore, {m_cprivmsg, 4}}
|
||||
|
@ -57,7 +74,7 @@ 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
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "logger.h"
|
||||
#include "supported.h"
|
||||
|
||||
static int mo_etrace(struct Client *, struct Client *, int, const char **);
|
||||
static int me_etrace(struct Client *, struct Client *, int, const char **);
|
||||
|
@ -69,8 +70,22 @@ struct Message masktrace_msgtab = {
|
|||
{mg_ignore, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_masktrace, 2}}
|
||||
};
|
||||
|
||||
static int
|
||||
_modinit(void)
|
||||
{
|
||||
add_isupport("ETRACE", isupport_string, "");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_moddeinit(void)
|
||||
{
|
||||
delete_isupport("ETRACE");
|
||||
}
|
||||
|
||||
mapi_clist_av1 etrace_clist[] = { &etrace_msgtab, &chantrace_msgtab, &masktrace_msgtab, NULL };
|
||||
DECLARE_MODULE_AV1(etrace, NULL, NULL, etrace_clist, NULL, NULL, "$Revision: 3161 $");
|
||||
DECLARE_MODULE_AV1(etrace, _modinit, _moddeinit, etrace_clist, NULL, NULL, "$Revision: 3161 $");
|
||||
|
||||
static void do_etrace(struct Client *source_p, int ipv4, int ipv6);
|
||||
static void do_etrace_full(struct Client *source_p);
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "s_serv.h"
|
||||
#include "supported.h"
|
||||
|
||||
static int m_knock(struct Client *, struct Client *, int, const char **);
|
||||
|
||||
|
@ -44,8 +45,21 @@ struct Message knock_msgtab = {
|
|||
{mg_unreg, {m_knock, 2}, {m_knock, 2}, mg_ignore, mg_ignore, {m_knock, 2}}
|
||||
};
|
||||
|
||||
static int
|
||||
_modinit(void)
|
||||
{
|
||||
add_isupport("KNOCK", isupport_boolean, &ConfigChannel.use_knock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_moddeinit(void)
|
||||
{
|
||||
delete_isupport("KNOCK");
|
||||
}
|
||||
|
||||
mapi_clist_av1 knock_clist[] = { &knock_msgtab, NULL };
|
||||
DECLARE_MODULE_AV1(knock, NULL, NULL, knock_clist, NULL, NULL, "$Revision: 3570 $");
|
||||
DECLARE_MODULE_AV1(knock, _modinit, _moddeinit, knock_clist, NULL, NULL, "$Revision: 3570 $");
|
||||
|
||||
/* m_knock
|
||||
* parv[1] = channel
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "modules.h"
|
||||
#include "whowas.h"
|
||||
#include "monitor.h"
|
||||
#include "supported.h"
|
||||
|
||||
static int _modinit(void);
|
||||
static void _moddeinit(void);
|
||||
|
@ -101,12 +102,14 @@ static int
|
|||
_modinit(void)
|
||||
{
|
||||
mark_services();
|
||||
add_isupport("FNC", isupport_string, "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_moddeinit(void)
|
||||
{
|
||||
delete_isupport("FNC");
|
||||
unmark_services();
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "packet.h"
|
||||
#include "s_newconf.h"
|
||||
#include "ratelimit.h"
|
||||
#include "supported.h"
|
||||
|
||||
#define FIELD_CHANNEL 0x0001
|
||||
#define FIELD_HOP 0x0002
|
||||
|
@ -69,8 +70,21 @@ struct Message who_msgtab = {
|
|||
{mg_unreg, {m_who, 2}, mg_ignore, mg_ignore, mg_ignore, {m_who, 2}}
|
||||
};
|
||||
|
||||
static int
|
||||
_modinit(void)
|
||||
{
|
||||
add_isupport("WHOX", isupport_string, "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_moddeinit(void)
|
||||
{
|
||||
delete_isupport("WHOX");
|
||||
}
|
||||
|
||||
mapi_clist_av1 who_clist[] = { &who_msgtab, NULL };
|
||||
DECLARE_MODULE_AV1(who, NULL, NULL, who_clist, NULL, NULL, "$Revision: 3350 $");
|
||||
DECLARE_MODULE_AV1(who, _modinit, _moddeinit, who_clist, NULL, NULL, "$Revision: 3350 $");
|
||||
|
||||
static void do_who_on_channel(struct Client *source_p, struct Channel *chptr,
|
||||
int server_oper, int member,
|
||||
|
|
|
@ -326,7 +326,6 @@ init_isupport(void)
|
|||
add_isupport("MAXLIST", isupport_maxlist, NULL);
|
||||
add_isupport("MODES", isupport_intptr, &maxmodes);
|
||||
add_isupport("NETWORK", isupport_stringptr, &ServerInfo.network_name);
|
||||
add_isupport("KNOCK", isupport_boolean, &ConfigChannel.use_knock);
|
||||
add_isupport("STATUSMSG", isupport_string, "@+");
|
||||
add_isupport("CALLERID", isupport_umode, "g");
|
||||
add_isupport("CASEMAPPING", isupport_string, "rfc1459");
|
||||
|
@ -334,13 +333,8 @@ init_isupport(void)
|
|||
add_isupport("MAXNICKLEN", isupport_intptr, &maxnicklen);
|
||||
add_isupport("CHANNELLEN", isupport_intptr, &channellen);
|
||||
add_isupport("TOPICLEN", isupport_intptr, &topiclen);
|
||||
add_isupport("ETRACE", isupport_string, "");
|
||||
add_isupport("CPRIVMSG", isupport_string, "");
|
||||
add_isupport("CNOTICE", isupport_string, "");
|
||||
add_isupport("DEAF", isupport_umode, "D");
|
||||
add_isupport("FNC", isupport_string, "");
|
||||
add_isupport("TARGMAX", isupport_targmax, NULL);
|
||||
add_isupport("EXTBAN", isupport_extban, NULL);
|
||||
add_isupport("WHOX", isupport_string, "");
|
||||
add_isupport("CLIENTVER", isupport_string, "3.0");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue