diff --git a/config.yml.example b/config.yml.example index 7aae0b4..af39338 100644 --- a/config.yml.example +++ b/config.yml.example @@ -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 diff --git a/main.py b/main.py index 304bb8f..3bb3b3e 100755 --- a/main.py +++ b/main.py @@ -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)