mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
irclib: Fix crash when MOTD is sent again later in the connection.
This can happen with this ZNC module: https://wiki.znc.in/Missingmotd or if a plugin sends a 'MOTD' command.
This commit is contained in:
parent
0a6bb49fe6
commit
5d80b2eec9
@ -515,6 +515,8 @@ class IrcStateFsm(object):
|
||||
self._transition(irc, msg, self.States.INIT_MOTD, [
|
||||
self.States.INIT_CAP_NEGOTIATION,
|
||||
self.States.INIT_WAITING_MOTD,
|
||||
self.States.CONNECTED,
|
||||
self.States.CONNECTED_SASL,
|
||||
])
|
||||
|
||||
def on_end_motd(self, irc, msg):
|
||||
@ -522,7 +524,9 @@ class IrcStateFsm(object):
|
||||
self._transition(irc, msg, self.States.CONNECTED, [
|
||||
self.States.INIT_CAP_NEGOTIATION,
|
||||
self.States.INIT_WAITING_MOTD,
|
||||
self.States.INIT_MOTD
|
||||
self.States.INIT_MOTD,
|
||||
self.States.CONNECTED,
|
||||
self.States.CONNECTED_SASL,
|
||||
])
|
||||
|
||||
def on_shutdown(self, irc, msg):
|
||||
|
@ -858,6 +858,17 @@ class IrcTestCase(SupyTestCase):
|
||||
self.irc.feedMsg(msg2)
|
||||
self.assertEqual(list(self.irc.state.history), [msg1, msg2])
|
||||
|
||||
def testMultipleMotd(self):
|
||||
self.irc.reset()
|
||||
|
||||
self.irc.feedMsg(ircmsgs.IrcMsg(command='422'))
|
||||
|
||||
self.irc.feedMsg(ircmsgs.IrcMsg(command='422'))
|
||||
|
||||
self.irc.feedMsg(ircmsgs.IrcMsg(command='375', args=['nick']))
|
||||
self.irc.feedMsg(ircmsgs.IrcMsg(command='372', args=['nick', 'some message']))
|
||||
self.irc.feedMsg(ircmsgs.IrcMsg(command='376', args=['nick']))
|
||||
|
||||
def testMsgChannel(self):
|
||||
self.irc.reset()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user