Add support for network-specific umodes.

This commit is contained in:
Valentin Lorentz 2012-08-06 15:59:00 +02:00
parent b5c99b1ce1
commit e3d170d9fe
2 changed files with 7 additions and 1 deletions

View File

@ -289,6 +289,10 @@ def registerNetwork(name, password='', ssl=False, sasl_username='',
registerGlobalValue(network, 'nick', ValidNickOrEmpty('', _("""Determines
what nick the bot will use on this network. If empty, defaults to
supybot.nick.""")))
registerGlobalValue(network, 'umodes',
registry.String('', _("""Determines what user modes the bot will request
from the server when it first connects. If empty, defaults to
supybot.protocols.irc.umodes""")))
sasl = registerGroup(network, 'sasl')
registerGlobalValue(sasl, 'username', registry.String(sasl_username,
_("""Determines what SASL username will be used on %s. This should

View File

@ -966,7 +966,9 @@ class Irc(IrcCommandDispatcher):
self.afterConnect = True
# Let's reset nicks in case we had to use a weird one.
self.alternateNicks = conf.supybot.nick.alternates()[:]
umodes = conf.supybot.protocols.irc.umodes()
umodes = conf.supybot.networks.get(self.network).umodes()
if umodes == '':
umodes = conf.supybot.protocols.irc.umodes()
supported = self.state.supported.get('umodes')
if umodes:
addSub = '+'