3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-11 20:52:42 +01:00

relay: also send internal hook for services login, for integration with automode

This commit is contained in:
James Lu 2016-07-07 21:43:25 -07:00
parent 0d502095c5
commit b3310eaf78
2 changed files with 10 additions and 0 deletions

View File

@ -232,3 +232,4 @@ def handle_services_login(irc, source, command, args):
match(irc, channel, source)
utils.add_hook(handle_services_login, 'CLIENT_SERVICES_LOGIN')
utils.add_hook(handle_services_login, 'PYLINK_RELAY_SERVICES_LOGIN')

View File

@ -1313,6 +1313,15 @@ def handle_endburst(irc, numeric, command, args):
initializeAll(irc)
utils.add_hook(handle_endburst, "ENDBURST")
def handle_services_login(irc, numeric, command, args):
"""
Relays services account changes as a hook, for integration with plugins like Automode.
"""
for netname, user in relayusers[(irc.name, numeric)].items():
remoteirc = world.networkobjects[netname]
remoteirc.callHooks([user, 'PYLINK_RELAY_SERVICES_LOGIN', args])
utils.add_hook(handle_services_login, 'CLIENT_SERVICES_LOGIN')
def handle_disconnect(irc, numeric, command, args):
"""Handles IRC network disconnections (internal hook)."""
# Quit all of our users' representations on other nets, and remove