Fix parsing of 004 message. (Broken in d9531d2d).

This commit is contained in:
Valentin Lorentz 2012-08-25 20:17:15 +02:00
parent 0780d445e2
commit d2ab53cd19
2 changed files with 4 additions and 4 deletions

View File

@ -406,10 +406,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 = [nickname, 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(':charm.oftc.net 004 adkwbot 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')