3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

clientbot: send CLIENTBOT_KICK payloads for external clients

This commit is contained in:
James Lu 2016-07-23 12:04:07 -07:00
parent a9be5d0dc7
commit a402d1057e

View File

@ -152,6 +152,11 @@ class ClientbotWrapperProtocol(Protocol):
log.debug('(%s) kick: adding %s to kick queue for channel %s', self.irc.name, target, channel)
self.kick_queue[channel][0].add(target)
if not irc.isInternalClient(target):
# Send a clientbot_kick hook only if the target is an external client. Kicks between
# users on fully-linked relay networks would otherwise have no message attached to them.
self.irc.callHooks([source, 'CLIENTBOT_KICK', {'channel': channel, 'target': target, 'text': reason}])
def message(self, source, target, text, notice=False):
"""Sends messages to the target."""
command = 'NOTICE' if notice else 'PRIVMSG'