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

core: make maxnicklen optional, defaulting it to 30

This commit is contained in:
James Lu 2016-06-27 22:39:18 -07:00
parent f458a40e1c
commit e4b400042e
2 changed files with 3 additions and 4 deletions

View File

@ -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': '+'}

View File

@ -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 \