mirror of
https://github.com/jlu5/PyLink.git
synced 2025-03-01 12:00:42 +01:00
relay: integrate with automode by sending relay JOINs as a hook
This commit is contained in:
parent
2be4811673
commit
0d502095c5
@ -222,6 +222,7 @@ def handle_join(irc, source, command, args):
|
|||||||
for uid in args['users']:
|
for uid in args['users']:
|
||||||
match(irc, channel, uid)
|
match(irc, channel, uid)
|
||||||
utils.add_hook(handle_join, 'JOIN')
|
utils.add_hook(handle_join, 'JOIN')
|
||||||
|
utils.add_hook(handle_join, 'PYLINK_RELAY_JOIN') # Handle the relay verison of join
|
||||||
|
|
||||||
def handle_services_login(irc, source, command, args):
|
def handle_services_login(irc, source, command, args):
|
||||||
"""
|
"""
|
||||||
|
@ -649,6 +649,11 @@ def relayJoins(irc, channel, users, ts, burst=True):
|
|||||||
# A regular JOIN only needs the user and the channel. TS, source SID, etc., can all be omitted.
|
# A regular JOIN only needs the user and the channel. TS, source SID, etc., can all be omitted.
|
||||||
remoteirc.proto.join(queued_users[0][1], remotechan)
|
remoteirc.proto.join(queued_users[0][1], remotechan)
|
||||||
|
|
||||||
|
# Announce this JOIN as a hook, for plugins like Automode. Is this a hack? Yeah.
|
||||||
|
# Plugins can communicate with each other using hooks.
|
||||||
|
remoteirc.callHooks([remoteirc.sid, 'PYLINK_RELAY_JOIN',
|
||||||
|
{'channel': remotechan, 'users': [u[-1] for u in queued_users]}])
|
||||||
|
|
||||||
def relayPart(irc, channel, user):
|
def relayPart(irc, channel, user):
|
||||||
"""
|
"""
|
||||||
Relays a user part from a channel to its relay links, as part of a channel delink.
|
Relays a user part from a channel to its relay links, as part of a channel delink.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user