mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 11:42:51 +01:00
relay: drop prefix modes if the target doesn't have a relay clone yet
This fixes modes like ('+v', None) from being accidentally sent by Relay, when Automode happens to set modes before all relay clients are spawned.
This commit is contained in:
parent
00766041f3
commit
df41dabb71
@ -403,9 +403,9 @@ def getOrigUser(irc, user, targetirc=None):
|
||||
# Otherwise, use getRemoteUser to find our UID.
|
||||
res = getRemoteUser(sourceobj, targetirc, remoteuser[1],
|
||||
spawnIfMissing=False)
|
||||
log.debug('(%s) relay.getOrigUser: targetirc found, getting %r as '
|
||||
'remoteuser for %r (looking up %s/%s).', irc.name, res,
|
||||
remoteuser[1], user, irc.name)
|
||||
log.debug('(%s) relay.getOrigUser: targetirc found as %s, getting %r as '
|
||||
'remoteuser for %r (looking up %s/%s).', irc.name, targetirc.name,
|
||||
res, remoteuser[1], user, irc.name)
|
||||
return res
|
||||
else:
|
||||
return remoteuser
|
||||
@ -740,6 +740,10 @@ def getSupportedCmodes(irc, remoteirc, channel, modes):
|
||||
arg = getOrigUser(irc, arg, targetirc=remoteirc) or \
|
||||
getRemoteUser(irc, remoteirc, arg, spawnIfMissing=False)
|
||||
|
||||
if arg is None:
|
||||
# Relay client for target user doesn't exist yet. Drop the mode.
|
||||
break
|
||||
|
||||
log.debug("(%s) relay.getSupportedCmodes: argument found as (%r, %r) "
|
||||
"for network %r.",
|
||||
irc.name, modechar, arg, remoteirc.name)
|
||||
|
Loading…
Reference in New Issue
Block a user