mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
clientbot: introduce virtual SQUIT and SJOIN hooks
This commit is contained in:
parent
62099e6078
commit
1c0900b29d
@ -227,12 +227,18 @@ class ClientbotWrapperProtocol(Protocol):
|
||||
self.irc.users[user].channels.add(channel)
|
||||
|
||||
self.irc.channels[channel].users |= puids
|
||||
nicks = {self.irc.getFriendlyName(u) for u in puids}
|
||||
self.irc.callHooks([server, 'CLIENTBOT_SJOIN', {'channel': channel, 'nicks': nicks}])
|
||||
|
||||
def squit(self, source, target, text):
|
||||
"""STUB: SQUITs a server."""
|
||||
# What this actually does is just handle the SQUIT internally: i.e.
|
||||
# Removing pseudoclients and pseudoservers.
|
||||
self._squit(source, 'CLIENTBOT_VIRTUAL_SQUIT', [target, text])
|
||||
squit_data = self._squit(source, 'CLIENTBOT_VIRTUAL_SQUIT', [target, text])
|
||||
|
||||
nicks = {self.irc.getFriendlyName(u) for u in squit_data['users']}
|
||||
|
||||
self.irc.callHooks([server, 'CLIENTBOT_SQUIT', {'nicks': nicks}])
|
||||
|
||||
def _stub(self, *args):
|
||||
"""Stub outgoing command function (does nothing)."""
|
||||
|
Loading…
Reference in New Issue
Block a user