mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-27 13:12:45 +01:00
Fix parsing of 004 message for supported umodes/chanmodes
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
parent
72077c8c97
commit
d9531d2d29
@ -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,
|
||||
|
@ -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'))
|
||||
|
Loading…
Reference in New Issue
Block a user