From 7f6c8b0e52e908270470146546ed4aa0518d1e03 Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 7 Jul 2015 10:55:14 -0700 Subject: [PATCH] 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 --- protocols/inspircd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index a05a9ed..d7f548c 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -376,6 +376,9 @@ def handle_events(irc, data): 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 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.maxchanlen = caps['CHANMAX'] # Modes are divided into A, B, C, and D classes