mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-02 15:59:26 +01:00
relay: disable "you must in a share channel" messages; they're buggy
This commit is contained in:
parent
ce822061d2
commit
3646930d34
@ -314,9 +314,14 @@ def handle_privmsg(irc, numeric, command, args):
|
|||||||
relay = findRelay((irc.name, target))
|
relay = findRelay((irc.name, target))
|
||||||
# Don't send any "you must be in common channels" if we're not part
|
# 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!
|
# 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 \
|
if utils.isChannel(target) and ((relay and not db[relay]['links']) or \
|
||||||
relay is None):
|
relay is None):
|
||||||
return
|
return
|
||||||
|
'''
|
||||||
|
if not remoteusers:
|
||||||
|
return
|
||||||
for netname, user in relayusers[(irc.name, numeric)].items():
|
for netname, user in relayusers[(irc.name, numeric)].items():
|
||||||
remoteirc = utils.networkobjects[netname]
|
remoteirc = utils.networkobjects[netname]
|
||||||
# HACK: Don't break on sending to @#channel or similar.
|
# HACK: Don't break on sending to @#channel or similar.
|
||||||
@ -342,6 +347,7 @@ def handle_privmsg(irc, numeric, command, args):
|
|||||||
else:
|
else:
|
||||||
remoteirc.proto.messageClient(remoteirc, user, real_target, text)
|
remoteirc.proto.messageClient(remoteirc, user, real_target, text)
|
||||||
sent += 1
|
sent += 1
|
||||||
|
'''
|
||||||
if not sent:
|
if not sent:
|
||||||
# We must be on a common channel with the target. Otherwise, the sender
|
# We must be on a common channel with the target. Otherwise, the sender
|
||||||
# doesn't have a client representing them on the remote network,
|
# 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)
|
target_s = repr(target)
|
||||||
utils.msg(irc, numeric, 'Error: You must be in %s in order to send messages.' % \
|
utils.msg(irc, numeric, 'Error: You must be in %s in order to send messages.' % \
|
||||||
target_s, notice=True)
|
target_s, notice=True)
|
||||||
|
'''
|
||||||
utils.add_hook(handle_privmsg, 'PRIVMSG')
|
utils.add_hook(handle_privmsg, 'PRIVMSG')
|
||||||
utils.add_hook(handle_privmsg, 'NOTICE')
|
utils.add_hook(handle_privmsg, 'NOTICE')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user