mirror of https://github.com/Shizmob/pydle.git
Remove channel information after being kicked or parting.
Also fixed _destroy_channel() to remove any users not in common anymore as a result of leaving the channel.
This commit is contained in:
parent
2d337a935c
commit
62298e7a44
|
@ -200,6 +200,8 @@ class BasicClient:
|
|||
}
|
||||
|
||||
def _destroy_channel(self, channel):
|
||||
for user in self.channels[channel]['users']:
|
||||
self._destroy_user(user, channel)
|
||||
del self.channels[channel]
|
||||
|
||||
|
||||
|
@ -636,9 +638,12 @@ class BasicClient:
|
|||
target, targetuser, targethost = protocol.parse_user(target)
|
||||
self._sync_user(target, targetuser, targethost)
|
||||
|
||||
# Update nick list on channel.
|
||||
if self.in_channel(channel):
|
||||
self._destroy_user(target, channel)
|
||||
if self.is_same_nick(target, self.nickname):
|
||||
self._destroy_channel(channel)
|
||||
else:
|
||||
# Update nick list on channel.
|
||||
if self.in_channel(channel):
|
||||
self._destroy_user(target, channel)
|
||||
|
||||
self.on_kick(channel, target, kicker, reason)
|
||||
|
||||
|
@ -727,7 +732,7 @@ class BasicClient:
|
|||
# We left the channel. Remove from channel list. :(
|
||||
for channel in channels:
|
||||
if self.in_channel(channel):
|
||||
del self.channels[channel]
|
||||
self._destroy_channel(channel)
|
||||
else:
|
||||
# Someone else left. Remove them.
|
||||
for ch in channels:
|
||||
|
|
Loading…
Reference in New Issue