mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 04:02:45 +01:00
clientbot: properly handle cases when the bot is told to kick itself
- Treat kicks to the PyLink client as a real user kick instead of a virtual one - Forward on kick hooks if the PyLink client is kick target - this allows things like autorejoin to work Closes #377.
This commit is contained in:
parent
79b3387bcb
commit
298913200c
@ -182,7 +182,7 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
|
||||
log.debug('(%s) kick: checking if target %s (nick: %s) is an internal client? %s',
|
||||
self.name, target, self.get_friendly_name(target),
|
||||
self.is_internal_client(target))
|
||||
if self.is_internal_client(target):
|
||||
if self.is_internal_client(target) and (self.pseudoclient and source != self.pseudoclient.uid):
|
||||
# Target was one of our virtual clients. Just remove them from the state.
|
||||
self.handle_part(target, 'KICK', [channel, reason])
|
||||
|
||||
@ -938,8 +938,10 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
if (not self.is_internal_client(source)) and not self.is_internal_server(source):
|
||||
# Don't repeat hooks if we're the kicker.
|
||||
# Don't repeat hooks if we're the kicker, unless we're also the target.
|
||||
if self.is_internal_client(source) or self.is_internal_server(source):
|
||||
if self.pseudoclient and target != self.pseudoclient.uid:
|
||||
return
|
||||
return {'channel': channel, 'target': target, 'text': reason}
|
||||
|
||||
def handle_mode(self, source, command, args):
|
||||
|
Loading…
Reference in New Issue
Block a user