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

BUILD : 1.7.8 (765) BUGS : 352 NOTES : Fixed various PTlink vhost handling bugs. Added a fake umode to indicate we have a vHost, to not break other IRCDs which DO use umodes. Ignoring PTlinks NEWMASK on SVSMODE +r, as that would desynch the services internal vhost.

git-svn-id: svn://svn.anope.org/anope/trunk@765 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@526 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b
2005-05-04 11:17:29 +00:00
parent a075334df1
commit 96832f34e7
5 changed files with 50 additions and 46 deletions
+30 -2
View File
@@ -79,7 +79,7 @@ IRCDVar myIrcd[] = {
CMODE_K, /* No Knock */
CMODE_A, /* Admin Only */
DEFAULT_MLOCK, /* Default MLOCK */
UMODE_o, /* Vhost Mode */
UMODE_VH, /* Vhost Mode */
1, /* +f */
0, /* +L */
CMODE_f,
@@ -429,6 +429,18 @@ int anope_event_newmask(char *source, int ac, char **av)
}
return MOD_CONT;
}
if ((u->mode & (UMODE_NM | UMODE_VH)) == (UMODE_NM | UMODE_VH)) {
/* This NEWMASK should be discarded because it's sent due to a +r by
* someone with a ptlink-masked host. PTlink has our correct host, so
* we can just ignore this :) Or we'll get ptlink's old host which is
* not what we want. -GD
*/
u->mode &= ~UMODE_NM;
if (debug)
alog("debug: Ignoring NEWMASK because it's send because of SVSMODE +r");
return MOD_CONT;
}
newuser = myStrGetOnlyToken(av[0], '@', 0);
if (newuser) {
@@ -440,7 +452,9 @@ int anope_event_newmask(char *source, int ac, char **av)
if (*newhost == '@')
newhost++;
u->mode |= UMODE_VH;
if (newhost) {
change_user_host(u, newhost);
}
@@ -699,6 +713,15 @@ void ptlink_cmd_svsmode(User * u, int ac, char **av)
{
send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0],
(ac == 2 ? " " : ""), (ac == 2 ? av[1] : ""));
/* If we set +r on someone +NRah (1 or more of those modes), PTlink will
* send us a NEWMASK with their ptlink-masked-host. If we want HostServ
* to work for them, we will need to send our NEWMASK after we receive
* theirs. Thus we make a hack and store in moduleData that we need to
* look out for that.
*/
if (strchr(av[0], 'r') && (u->mode & UMODE_N) || (u->mode & UMODE_R) || (u->mode & UMODE_a) || (u->mode & UMODE_h))
u->mode |= UMODE_NM;
}
int anope_event_error(char *source, int ac, char **av)
@@ -1180,11 +1203,16 @@ void ptlink_cmd_vhost_off(User * u)
void ptlink_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
{
User *u;
if (vIdent) {
send_cmd(s_HostServ, "NEWMASK %s@%s %s", vIdent, vhost, nick);
} else {
send_cmd(s_HostServ, "NEWMASK %s %s", vhost, nick);
}
if ((u = finduser(nick)))
u->mode |= UMODE_VH;
}
/* INVITE */
+3
View File
@@ -31,6 +31,9 @@
#define UMODE_y 0x00002000
#define UMODE_z 0x00004000
#define UMODE_VH 0x00008000 /* Fake umode used for internal vhost things */
#define UMODE_NM 0x00010000 /* Fake umode used for internal NEWMASK things */
/* Let's hope for a better vhost-system with PTlink7 ;) */
#define CMODE_i 0x00000001