3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

inspircd: warn when using InspIRCd 2 compat mode on an InspIRCd 3 uplink

Some commands like KICK are not mangled correctly in this mode.
This commit is contained in:
James Lu 2019-12-22 22:36:42 -08:00
parent dadf2c3211
commit 594b7124ff
2 changed files with 9 additions and 8 deletions

View File

@ -76,7 +76,7 @@ These IRCds (in alphabetical order) are frequently tested and well supported. If
* [charybdis](https://github.com/charybdis-ircd/charybdis) (3.5+) - module `ts6`
- For KLINE support to work, a `shared{}` block should be added for PyLink on all servers.
* [InspIRCd](http://www.inspircd.org/) 2.0 - 3.x - module `inspircd`
Set the `target_version` option to `insp3` to target InspIRCd 3.x, or `insp20` to target InspIRCd 2.0 (currently the default).
- Set the `target_version` option to `insp3` to target InspIRCd 3.x, or `insp20` to target InspIRCd 2.0 (currently the default).
- For vHost setting to work, `m_chghost.so` must be loaded. For ident and realname changing support, `m_chgident.so` and `m_chgname.so` must be loaded respectively.
- Supported channel, user, and prefix modes are negotiated on connect, but hotloading modules that change these is not supported. After changing module configuration, it is recommended to SQUIT PyLink to force a protocol renegotiation.
* [Nefarious IRCu](https://github.com/evilnet/nefarious2) (2.0.0+) - module `p10`

View File

@ -491,8 +491,8 @@ class InspIRCdProtocol(TS6BaseProtocol):
Handles the CAPAB command, used for capability negotiation with our
uplink.
"""
# 6 CAPAB commands are usually sent on connect: CAPAB START, MODULES,
# MODSUPPORT, CHANMODES, USERMODES, and CAPABILITIES.
# 5 CAPAB subcommands are usually sent on connect (excluding START and END):
# CAPAB MODULES, MODSUPPORT, CHANMODES, USERMODES, and CAPABILITIES
# We check just about everything except MODULES
if args[0] == 'START':
@ -503,6 +503,7 @@ class InspIRCdProtocol(TS6BaseProtocol):
# <- CAPAB START 1205
self.remote_proto_ver = protocol_version = int(args[1])
log.debug("(%s) handle_capab: got remote protocol version %s", self.name, protocol_version)
if protocol_version < self.proto_ver:
raise ProtocolError("Remote protocol version is too old! "
"At least %s is needed. (got %s)" %
@ -512,11 +513,11 @@ class InspIRCdProtocol(TS6BaseProtocol):
"and should not be relied upon for anything important.",
self.name)
elif protocol_version >= 1205 > self.proto_ver:
log.info("(%s) PyLink 2.1 introduces native support for InspIRCd 3.0. "
"You can enable this by setting the 'target_version' option in your "
"InspIRCd server block to 'insp3'.", self.name)
log.info("(%s) Falling back to InspIRCd 2.0 (compatibility) mode.", self.name)
log.debug("(%s) inspircd: got remote protocol version %s", self.name, protocol_version)
log.warning("(%s) PyLink 2.1 introduces native support for InspIRCd 3. "
"You should enable this by setting the 'target_version' option in your "
"InspIRCd server block to 'insp3'. Otherwise, some features will not "
"work correctly!", self.name)
log.warning("(%s) Falling back to InspIRCd 2.0 (compatibility) mode.", self.name)
if self.proto_ver >= 1205:
# Clear mode lists, they will be negotiated during burst