3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

relay: disable "you must in a share channel" messages; they're buggy

This commit is contained in:
James Lu 2015-07-29 04:02:45 -07:00
parent ce822061d2
commit 3646930d34

View File

@ -314,9 +314,14 @@ def handle_privmsg(irc, numeric, command, args):
relay = findRelay((irc.name, target))
# Don't send any "you must be in common channels" if we're not part
# of a relay, or we are but there are no links!
remoteusers = relayusers[(irc.name, numeric)].items()
'''
if utils.isChannel(target) and ((relay and not db[relay]['links']) or \
relay is None):
return
'''
if not remoteusers:
return
for netname, user in relayusers[(irc.name, numeric)].items():
remoteirc = utils.networkobjects[netname]
# HACK: Don't break on sending to @#channel or similar.
@ -342,6 +347,7 @@ def handle_privmsg(irc, numeric, command, args):
else:
remoteirc.proto.messageClient(remoteirc, user, real_target, text)
sent += 1
'''
if not sent:
# We must be on a common channel with the target. Otherwise, the sender
# doesn't have a client representing them on the remote network,
@ -354,6 +360,7 @@ def handle_privmsg(irc, numeric, command, args):
target_s = repr(target)
utils.msg(irc, numeric, 'Error: You must be in %s in order to send messages.' % \
target_s, notice=True)
'''
utils.add_hook(handle_privmsg, 'PRIVMSG')
utils.add_hook(handle_privmsg, 'NOTICE')