3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +01:00

pr/inspircd: enforce minimum protocol version of 1202

We're using InspIRCd 2.0+ specific features (SAVE, CAPAB CHAN/USERMODES), so this is required.
Source: https://wiki.inspircd.org/List_of_protocol_changes_between_versions#Version_1202
This commit is contained in:
James Lu 2015-07-07 10:55:14 -07:00
parent 4cc7781f0d
commit 7f6c8b0e52

View File

@ -376,6 +376,9 @@ def handle_events(irc, data):
elif args[1] == 'CAPABILITIES': elif args[1] == 'CAPABILITIES':
# <- CAPAB CAPABILITIES :NICKMAX=21 CHANMAX=64 MAXMODES=20 IDENTMAX=11 MAXQUIT=255 MAXTOPIC=307 MAXKICK=255 MAXGECOS=128 MAXAWAY=200 IP6SUPPORT=1 PROTOCOL=1202 PREFIX=(Yqaohv)!~&@%+ CHANMODES=IXbegw,k,FHJLfjl,ACKMNOPQRSTUcimnprstz USERMODES=,,s,BHIRSWcghikorwx GLOBOPS=1 SVSPART=1 # <- CAPAB CAPABILITIES :NICKMAX=21 CHANMAX=64 MAXMODES=20 IDENTMAX=11 MAXQUIT=255 MAXTOPIC=307 MAXKICK=255 MAXGECOS=128 MAXAWAY=200 IP6SUPPORT=1 PROTOCOL=1202 PREFIX=(Yqaohv)!~&@%+ CHANMODES=IXbegw,k,FHJLfjl,ACKMNOPQRSTUcimnprstz USERMODES=,,s,BHIRSWcghikorwx GLOBOPS=1 SVSPART=1
caps = dict([x.lstrip(':').split('=') for x in args[2:]]) caps = dict([x.lstrip(':').split('=') for x in args[2:]])
protocol_version = int(caps['PROTOCOL'])
if protocol_version < 1202:
raise ProtocolError("Remote protocol version is too old! At least 1202 (InspIRCd 2.0.x) is needed. (got %s)" % protocol_version)
irc.maxnicklen = caps['NICKMAX'] irc.maxnicklen = caps['NICKMAX']
irc.maxchanlen = caps['CHANMAX'] irc.maxchanlen = caps['CHANMAX']
# Modes are divided into A, B, C, and D classes # Modes are divided into A, B, C, and D classes