mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-03 16:14:10 +01:00
relay: don't spam ulines with "notice failed" errors
This commit is contained in:
parent
5bffe67416
commit
180bfa9917
@ -1474,16 +1474,20 @@ def handle_messages(irc, numeric, command, args):
|
|||||||
# Otherwise, the sender doesn't have a client representing them
|
# Otherwise, the sender doesn't have a client representing them
|
||||||
# on the remote network, and we won't have anything to send our
|
# on the remote network, and we won't have anything to send our
|
||||||
# messages from.
|
# messages from.
|
||||||
|
# Note: don't spam ulined senders (e.g. services announcers) with
|
||||||
|
# these notices.
|
||||||
if homenet not in remoteusers.keys():
|
if homenet not in remoteusers.keys():
|
||||||
irc.msg(numeric, 'You must be in a common channel '
|
if not _is_uline(irc, numeric):
|
||||||
'with %r in order to send messages.' % \
|
irc.msg(numeric, 'You must be in a common channel '
|
||||||
irc.users[target].nick, notice=True)
|
'with %r in order to send messages.' % \
|
||||||
|
irc.users[target].nick, notice=True)
|
||||||
return
|
return
|
||||||
remoteirc = world.networkobjects[homenet]
|
remoteirc = world.networkobjects[homenet]
|
||||||
|
|
||||||
if (not remoteirc.has_cap('can-spawn-clients')) and not conf.conf.get('relay', {}).get('allow_clientbot_pms'):
|
if (not remoteirc.has_cap('can-spawn-clients')) and not conf.conf.get('relay', {}).get('allow_clientbot_pms'):
|
||||||
irc.msg(numeric, 'Private messages to users connected via Clientbot have '
|
if not _is_uline(irc, numeric):
|
||||||
'been administratively disabled.', notice=True)
|
irc.msg(numeric, 'Private messages to users connected via Clientbot have '
|
||||||
|
'been administratively disabled.', notice=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
user = get_remote_user(irc, remoteirc, numeric, spawn_if_missing=False)
|
user = get_remote_user(irc, remoteirc, numeric, spawn_if_missing=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user