diff --git a/src/irclib.py b/src/irclib.py index 822631977..82ada6441 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -406,10 +406,10 @@ class IrcState(IrcCommandDispatcher): """Handles parsing the 004 reply Supported user and channel modes are cached""" - # msg.args = [nick, server, ircd-version, umodes, modes, + # msg.args = [server, ircd-version, umodes, modes, # modes that require arguments? (non-standard)] - self.supported['umodes'] = msg.args[3] - self.supported['chanmodes'] = msg.args[4] + self.supported['umodes'] = msg.args[2] + self.supported['chanmodes'] = msg.args[3] _005converters = utils.InsensitivePreservingDict({ 'modes': int, diff --git a/test/test_irclib.py b/test/test_irclib.py index f2df6c920..2fba31c52 100644 --- a/test/test_irclib.py +++ b/test/test_irclib.py @@ -290,6 +290,13 @@ class IrcStateTestCase(SupyTestCase): state.addMsg(self.irc, ircmsgs.IrcMsg(':irc.inet.tele.dk 005 adkwbot WALLCHOPS KNOCK EXCEPTS INVEX MODES=4 MAXCHANNELS=20 MAXBANS=beI:100 MAXTARGETS=4 NICKLEN=9 TOPICLEN=120 KICKLEN=90 :are supported by this server')) self.assertEqual(state.supported['maxbans'], 100) + def testSupportedUmodes(self): + state = irclib.IrcState() + state.addMsg(self.irc, ircmsgs.IrcMsg(':charm.oftc.net 004 charm.oftc.net hybrid-7.2.2+oftc1.6.8 CDGPRSabcdfgiklnorsuwxyz biklmnopstveI bkloveI')) + self.assertEqual(state.supported['umodes'], 'CDGPRSabcdfgiklnorsuwxyz') + self.assertEqual(state.supported['chanmodes'], + 'biklmnopstveI') + def testEmptyTopic(self): state = irclib.IrcState() state.addMsg(self.irc, ircmsgs.topic('#foo'))