Fix regression in parsing 004 messages

This was introduced in commit 4232e40e26

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2012-08-26 12:59:41 -04:00
parent 19a8df5b46
commit c74e8f35ab
2 changed files with 4 additions and 4 deletions

View File

@ -404,10 +404,10 @@ class IrcState(IrcCommandDispatcher):
"""Handles parsing the 004 reply
Supported user and channel modes are cached"""
# msg.args = [server, ircd-version, umodes, modes,
# msg.args = [nick, server, ircd-version, umodes, modes,
# modes that require arguments? (non-standard)]
self.supported['umodes'] = msg.args[2]
self.supported['chanmodes'] = msg.args[3]
self.supported['umodes'] = msg.args[3]
self.supported['chanmodes'] = msg.args[4]
_005converters = utils.InsensitivePreservingDict({
'modes': int,

View File

@ -292,7 +292,7 @@ class IrcStateTestCase(SupyTestCase):
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'))
state.addMsg(self.irc, ircmsgs.IrcMsg(':coulomb.oftc.net 004 testnick coulomb.oftc.net hybrid-7.2.2+oftc1.6.8 CDGPRSabcdfgiklnorsuwxyz biklmnopstveI bkloveI'))
self.assertEqual(state.supported['umodes'], 'CDGPRSabcdfgiklnorsuwxyz')
self.assertEqual(state.supported['chanmodes'],
'biklmnopstveI')