3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

clientbot: properly bounce kicks on networks not implementing them

This commit is contained in:
James Lu 2019-02-10 13:01:31 -08:00
parent a9b8bfe94d
commit 873283e61e

View File

@ -85,9 +85,10 @@ class ClientbotBaseProtocol(PyLinkNetworkCoreWithUtils):
def kick(self, source, channel, target, reason=''):
"""STUB: rejoins users on kick attempts, for server transports where kicking users from channels is not implemented."""
if self.is_internal_client(target):
if not self.is_internal_client(target):
log.info("(%s) Rejoining user %s to %s since kicks are not supported here.", self.name, target, channel)
self.join(target, channel)
self.call_hooks([None, 'JOIN', {'channel': channel, 'users': [target], 'modes': []}])
elif channel in self.channels:
self.channels[channel].remove_user(target)
self.users[target].channels.discard(channel)