3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

Make default max nick length a config option

This commit is contained in:
James Lu 2015-08-03 19:42:26 -07:00
parent fdcb58ba2c
commit 042edb3e1c
2 changed files with 9 additions and 7 deletions

View File

@ -51,6 +51,10 @@ servers:
# Separator character (used by relay)
separator: "/"
# Sets the max nick length for the network. It is important this is set correctly, or
# PyLink might introduce a nick that is too long and cause netsplits!
maxnicklen: 30
# Plugins to load (omit the .py extension)
plugins:
- commands

12
main.py
View File

@ -36,13 +36,11 @@ class Irc():
'oper': 'o',
'*A': '', '*B': '', '*C': 's', '*D': 'iow'}
# This nicklen value is only a default, and SHOULD be set by the
# protocol module as soon as the relevant capability information is
# received from the uplink. Plugins that depend on maxnicklen being
# set MUST call "irc.connected.wait()", which blocks until the
# capability information is received. This handling of irc.connected
# is also dependent on the protocol module.
self.maxnicklen = 30
# 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']
self.prefixmodes = {'o': '@', 'v': '+'}
# Uplink SID (filled in by protocol module)