Fix IRC.do376's handling of supported state

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit d6336421e0)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
This commit is contained in:
James McCoy 2011-11-07 05:58:48 -05:00 committed by Daniel Folkinshteyn
parent 23f07cadc2
commit 2fb9ac2024

View File

@ -929,13 +929,13 @@ class Irc(IrcCommandDispatcher):
# Let's reset nicks in case we had to use a weird one. # Let's reset nicks in case we had to use a weird one.
self.alternateNicks = conf.supybot.nick.alternates()[:] self.alternateNicks = conf.supybot.nick.alternates()[:]
umodes = conf.supybot.protocols.irc.umodes() umodes = conf.supybot.protocols.irc.umodes()
supported = self.supported.get('umodes') supported = self.state.supported.get('umodes')
if umodes: if umodes:
addSub = '+' addSub = '+'
if umodes[0] in '+-': if umodes[0] in '+-':
(addSub, umodes) = (umodes[0], umodes[1:]) (addSub, umodes) = (umodes[0], umodes[1:])
if supported: if supported:
umodes = [m for m in umodes if m in supported] umodes = ''.join([m for m in umodes if m in supported])
umodes = ''.join(addSub, umodes) umodes = ''.join(addSub, umodes)
log.info('Sending user modes to %s: %s', self.network, umodes) log.info('Sending user modes to %s: %s', self.network, umodes)
self.sendMsg(ircmsgs.mode(self.nick, umodes)) self.sendMsg(ircmsgs.mode(self.nick, umodes))