From e4b400042ecd6a76146e4a9299cf7a1af7f8d2cf Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 27 Jun 2016 22:39:18 -0700 Subject: [PATCH] core: make maxnicklen optional, defaulting it to 30 --- classes.py | 5 ++--- conf.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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 \