diff --git a/classes.py b/classes.py index 788116b..859d6f5 100644 --- a/classes.py +++ b/classes.py @@ -146,9 +146,8 @@ class Irc(): # This max nick length starts off as the config value, but may be # overwritten later by the protocol module if such information is - # received. Note that only some IRCds (InspIRCd) give us nick length - # during link, so it is still required that the config value be set! - self.maxnicklen = self.serverdata['maxnicklen'] + # received. It defaults to 30. + self.maxnicklen = self.serverdata.get('maxnicklen', 30) # Defines a list of supported prefix modes. self.prefixmodes = {'o': '@', 'v': '+'} diff --git a/conf.py b/conf.py index 686c45c..d7871db 100644 --- a/conf.py +++ b/conf.py @@ -48,7 +48,7 @@ def validateConf(conf): for netname, serverblock in conf['servers'].items(): for section in ('ip', 'port', 'recvpass', 'sendpass', 'hostname', - 'sid', 'sidrange', 'protocol', 'maxnicklen'): + 'sid', 'sidrange', 'protocol'): assert serverblock.get(section), "Missing %r in server block for %r." % (section, netname) assert type(conf['login'].get('password')) == type(conf['login'].get('user')) == str and \