summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark mark@31f1291d-b8d6-0310-a050-a5561fc1590b <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2008-08-17 13:03:53 +0000
committermark mark@31f1291d-b8d6-0310-a050-a5561fc1590b <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2008-08-17 13:03:53 +0000
commitf8ae0732fe9a24269144777697ca8c717d7d12c6 (patch)
tree83122574edab48f2034a4ffff9e0cde780be6258
parente9ec7df0b50039626e6689bb873b677170cd0580 (diff)
BUILD : 1.7.21 (1413) BUGS : 832 NOTES : Added support for channelmodes +efI and SVSHOLD to inspircd11.c
git-svn-id: svn://svn.anope.org/anope/trunk@1413 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1128 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rw-r--r--src/protocol/inspircd11.c89
-rw-r--r--version.log6
3 files changed, 78 insertions, 18 deletions
diff --git a/Changes b/Changes
index c51685f30..b321744cd 100644
--- a/Changes
+++ b/Changes
@@ -46,6 +46,7 @@ Anope Version S V N
05/12 F moduleNoticeLang() now calls notice_user instead of notice(). [ #00]
08/11 F Updated os_raw.c to show up as a 3rd party module. [ #00]
08/15 F CS OP now correctly works if there is only 1 user in the channel. [#922]
+08/17 F Various InspIRCd issues. [#832]
Provided by Robin Burchell <w00t@inspircd.org> - 2008
08/08 F Strict warnings in send.c from comparing address of non-ptr [ #00]
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index 7fdca914a..612b7c616 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -279,7 +279,7 @@ CBMode myCbmodes[128] = {
{CMODE_c, 0, NULL, NULL},
{0}, /* d */
{0}, /* e */
- {CMODE_f, 0, set_flood, cs_set_flood},
+ {0}, /* f */
{0}, /* g */
{0}, /* h */
{CMODE_i, 0, NULL, NULL},
@@ -304,8 +304,8 @@ CBMode myCbmodes[128] = {
};
CBModeInfo myCbmodeinfos[] = {
+ {'f', CMODE_f, 0, NULL, NULL},
{'c', CMODE_c, 0, NULL, NULL},
- {'f', CMODE_f, 0, get_flood, cs_get_flood},
{'i', CMODE_i, 0, NULL, NULL},
{'k', CMODE_k, 0, get_key, cs_get_key},
{'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit},
@@ -379,15 +379,18 @@ CUMode myCumodes[128] = {
{0}, {0}, {0}, {0}, {0}
};
-int has_servicesmod = 0;
-int has_globopsmod = 0;
+static int has_servicesmod = 0;
+static int has_globopsmod = 0;
/* These are sanity checks to insure we are supported.
The ircd tends to /squit us if we issue unsupported cmds.
- katsklaw */
-int has_svsholdmod = 0;
-int has_chghostmod = 0;
-int has_chgidentmod = 0;
+static int has_svsholdmod = 0;
+static int has_chghostmod = 0;
+static int has_chgidentmod = 0;
+static int has_messagefloodmod = 0;
+static int has_banexceptionmod = 0;
+static int has_inviteexceptionmod = 0;
void inspircd_set_umode(User * user, int ac, char **av)
{
@@ -1494,6 +1497,7 @@ int anope_event_capab(char *source, int ac, char **av)
{
int argc;
char **argv;
+ CBModeInfo *cbmi;
if (strcasecmp(av[0], "START") == 0) {
/* reset CAPAB */
@@ -1519,36 +1523,91 @@ int anope_event_capab(char *source, int ac, char **av)
if (strstr(av[1], "m_chgident.so")) {
has_chgidentmod = 1;
}
+ if (strstr(av[1], "m_messageflood.so")) {
+ has_messagefloodmod = 1;
+ }
+ if (strstr(av[1], "m_banexception.so")) {
+ has_banexceptionmod = 1;
+ }
+ if (strstr(av[1], "m_inviteexception.so")) {
+ has_inviteexceptionmod = 1;
+ }
} else if (strcasecmp(av[0], "END") == 0) {
- if (has_globopsmod == 0) {
+ if (!has_globopsmod) {
send_cmd(NULL,
"ERROR :m_globops is not loaded. This is required by Anope");
quitmsg = "Remote server does not have the m_globops module loaded, and this is required.";
quitting = 1;
return MOD_STOP;
}
- if (has_servicesmod == 0) {
+ if (!has_servicesmod) {
send_cmd(NULL,
"ERROR :m_services is not loaded. This is required by Anope");
quitmsg = "Remote server does not have the m_services module loaded, and this is required.";
quitting = 1;
return MOD_STOP;
}
- if (has_svsholdmod == 0) {
+ if (!has_svsholdmod) {
anope_cmd_global(s_OperServ, "SVSHOLD missing, Usage disabled until module is loaded.");
}
- if (has_chghostmod == 0) {
+ if (!has_chghostmod) {
anope_cmd_global(s_OperServ, "CHGHOST missing, Usage disabled until module is loaded.");
}
- if (has_chgidentmod == 0) {
+ if (!has_chgidentmod) {
anope_cmd_global(s_OperServ, "CHGIDENT missing, Usage disabled until module is loaded.");
}
+ if (has_messagefloodmod) {
+ cbmi = myCbmodeinfos;
+
+ /* Find 'f' in myCbmodeinfos and add the relevant bits to myCbmodes and myCbmodeinfos
+ * to enable +f support if found. This is needed because we're really not set up to
+ * handle modular ircds which can have modes enabled/disabled as they please :( - mark
+ */
+ while ((cbmi->mode != 'f')) {
+ cbmi++;
+ }
+ if (cbmi) {
+ myCbmodeinfos->getvalue = get_flood;
+ myCbmodeinfos->csgetvalue = cs_get_flood;
+
+ myCbmodes['f'].flag = CMODE_f;
+ myCbmodes['f'].flags = 0;
+ myCbmodes['f'].setvalue = set_flood;
+ myCbmodes['f'].cssetvalue = cs_set_flood;
+
+ pmodule_ircd_cbmodeinfos(myCbmodeinfos);
+ pmodule_ircd_cbmodes(myCbmodes);
+
+ ircd->fmode = 1;
+ }
+ else {
+ alog("Support for channelmode +f can not be enabled");
+ if (debug) {
+ alog("debug: 'f' missing from myCbmodeinfos");
+ }
+ }
+ }
+ if (has_banexceptionmod) {
+ myCmmodes['e'].addmask = add_exception;
+ myCmmodes['e'].delmask = del_exception;
+ ircd->except = 1;
+ }
+ if (has_inviteexceptionmod) {
+ myCmmodes['I'].addmask = add_invite;
+ myCmmodes['I'].delmask = del_invite;
+ ircd->invitemode = 1;
+ }
+ ircd->svshold = has_svsholdmod;
+ if (has_banexceptionmod || has_inviteexceptionmod) {
+ pmodule_ircd_cmmodes(myCmmodes);
+ }
+
/* Generate a fake capabs parsing call so things like NOQUIT work
* fine. It's ugly, but it works....
*/
argc = 6;
- argv = scalloc(6, sizeof(char *));
+ argv = scalloc(argc, sizeof(char *));
argv[0] = "NOQUIT";
argv[1] = "SSJ3";
argv[2] = "NICK2";
@@ -1564,18 +1623,14 @@ int anope_event_capab(char *source, int ac, char **av)
/* SVSHOLD - set */
void inspircd_cmd_svshold(char *nick)
{
- if (has_svsholdmod == 1) {
send_cmd(s_OperServ, "SVSHOLD %s %ds :%s", nick, NSReleaseTimeout,
"Being held for registered user");
- }
}
/* SVSHOLD - release */
void inspircd_cmd_release_svshold(char *nick)
{
- if (has_svsholdmod == 1) {
send_cmd(s_OperServ, "SVSHOLD %s", nick);
- }
}
/* UNSGLINE */
diff --git a/version.log b/version.log
index 3775d5f83..d79af2b56 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="21"
VERSION_EXTRA="-svn"
-VERSION_BUILD="1412"
+VERSION_BUILD="1413"
# $Log$
#
+# BUILD : 1.7.21 (1413)
+# BUGS : 832
+# NOTES : Added support for channelmodes +efI and SVSHOLD to inspircd11.c
+#
# BUILD : 1.7.21 (1412)
# BUGS :
# NOTES : Fixed the SVN ID/module version for inspircd11.c