From e3d170d9fed35a4a55e3f959669dcc89973b0b5b Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 6 Aug 2012 15:59:00 +0200 Subject: [PATCH] Add support for network-specific umodes. --- src/conf.py | 4 ++++ src/irclib.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/conf.py b/src/conf.py index 208864adc..2207d8618 100644 --- a/src/conf.py +++ b/src/conf.py @@ -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 diff --git a/src/irclib.py b/src/irclib.py index 85482ac70..424a22e6b 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -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 = '+'