1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 15:03:14 +02:00

Recieve the max number of modes we can set at once from the IRCd and use it

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2783 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2010-02-06 19:27:32 +00:00
parent 87b62c433d
commit 4099944013
8 changed files with 20 additions and 2 deletions
+2
View File
@@ -199,6 +199,8 @@ How To Add IRCd Support
43) Delayed AUTH: Does the ircd send if a user is identified for their nick
AFTER the initial NICK/UID? Set this to 0 for no.
44) Max Modes: The max number of mode changes we can send in one line
So we've had this long list. Now there's a second struct to fill. This
struct isn't as long as the previous one though, so we'll handle it quite
quick compared to the previous one.
+1
View File
@@ -420,6 +420,7 @@ struct ircdvars_ {
* for ircd specific support (nefarious only cares about first /mask) */
const char *globaltldprefix; /* TLD prefix used for Global */
bool b_delay_auth; /* Auth for users is sent after the initial NICK/UID command */
int maxmodes; /* Max modes to send per line */
};
struct ircdcapab_ {
+2 -2
View File
@@ -484,7 +484,7 @@ std::list<std::string> ModeManager::BuildModeStrings(StackerInfo *info)
buf = "+";
for (it = info->AddModes.begin(); it != info->AddModes.end(); ++it)
{
if (++Modes > 12) //XXX this number needs to be recieved from the ircd
if (++Modes > ircd->maxmodes)
{
ret.push_back(buf + parambuf);
buf = "+";
@@ -513,7 +513,7 @@ std::list<std::string> ModeManager::BuildModeStrings(StackerInfo *info)
buf += "-";
for (it = info->DelModes.begin(); it != info->DelModes.end(); ++it)
{
if (++Modes > 12) //XXX this number needs to be recieved from the ircd
if (++Modes > ircd->maxmodes)
{
ret.push_back(buf + parambuf);
buf = "-";
+1
View File
@@ -56,6 +56,7 @@ IRCDVar myIrcd[] = {
0, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
false, /* Auth for users is sent after the initial NICK/UID command */
6, /* Max number of modes we can send per line */
}
,
{NULL}
+6
View File
@@ -73,6 +73,7 @@ IRCDVar myIrcd[] = {
1, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
false, /* Auth for users is sent after the initial NICK/UID command */
20, /* Max number of modes we can send per line */
}
,
{NULL}
@@ -1079,6 +1080,11 @@ int anope_event_capab(const char *source, int ac, const char **av)
}
}
}
else if (capab.find("MAXMODES=") != std::string::npos)
{
std::string maxmodes(capab.begin() + 10, capab.end());
ircd->maxmodes = atoi(maxmodes.c_str());
}
}
} else if (strcasecmp(av[0], "END") == 0) {
if (!has_globopsmod) {
+6
View File
@@ -73,6 +73,7 @@ IRCDVar myIrcd[] = {
1, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
true, /* Auth for users is sent after the initial NICK/UID command */
20, /* Max number of modes we can send per line */
}
,
{NULL}
@@ -1266,6 +1267,11 @@ int anope_event_capab(const char *source, int ac, const char **av)
}
}
}
else if (capab.find("MAXMODES=") != std::string::npos)
{
std::string maxmodes(capab.begin() + 10, capab.end());
ircd->maxmodes = atoi(maxmodes.c_str());
}
}
} else if (strcasecmp(av[0], "END") == 0) {
if (!has_globopsmod) {
+1
View File
@@ -54,6 +54,7 @@ IRCDVar myIrcd[] = {
0, /* CIDR channelbans */
"$$", /* TLD Prefix for Global */
false, /* Auth for users is sent after the initial NICK/UID command */
4, /* Max number of modes we can send per line */
}
,
{NULL}
+1
View File
@@ -56,6 +56,7 @@ IRCDVar myIrcd[] = {
0, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
false, /* Auth for users is sent after the initial NICK/UID command */
12, /* Max number of modes we can send per line */
}
,
{NULL}