mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-18 16:12:42 +01:00
Fixed bug in irclib.IrcState's handling of KICK messages; they wouldn't remove the channel if the bot was kicked from it.
This commit is contained in:
parent
5fd6bbb52d
commit
c08d435267
@ -498,7 +498,11 @@ class IrcState(IrcCommandDispatcher):
|
||||
(channel, users) = msg.args[:2]
|
||||
chan = self.channels[channel]
|
||||
for user in users.split(','):
|
||||
chan.removeUser(user)
|
||||
if ircutils.strEqual(user, irc.nick):
|
||||
del self.channels[channel]
|
||||
return
|
||||
else:
|
||||
chan.removeUser(user)
|
||||
|
||||
def doQuit(self, irc, msg):
|
||||
for channel in self.channels.itervalues():
|
||||
|
@ -210,6 +210,13 @@ class IrcStateTestCase(SupyTestCase):
|
||||
nick = 'nick'
|
||||
prefix = 'nick!user@host'
|
||||
irc = FakeIrc()
|
||||
def testKickRemovesChannel(self):
|
||||
st = irclib.IrcState()
|
||||
st.channels['#foo'] = irclib.ChannelState()
|
||||
m = ircmsgs.kick('#foo', self.irc.nick, prefix=self.irc.prefix)
|
||||
st.addMsg(self.irc, m)
|
||||
self.failIf('#foo' in st.channels)
|
||||
|
||||
def testAddMsgRemovesOpsProperly(self):
|
||||
st = irclib.IrcState()
|
||||
st.channels['#foo'] = irclib.ChannelState()
|
||||
|
Loading…
Reference in New Issue
Block a user