mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-28 05:29:25 +01:00
relay: don't send empty MODE commands if there are no supported modes left after filtering
This commit is contained in:
parent
cf32461d8e
commit
2a586a6dba
@ -88,10 +88,13 @@ def getRemoteUser(irc, remoteirc, user):
|
|||||||
# If the user (stored here as {(netname, UID):
|
# If the user (stored here as {(netname, UID):
|
||||||
# {network1: UID1, network2: UID2}}) exists, don't spawn it
|
# {network1: UID1, network2: UID2}}) exists, don't spawn it
|
||||||
# again!
|
# again!
|
||||||
|
try:
|
||||||
if user == remoteirc.pseudoclient.uid:
|
if user == remoteirc.pseudoclient.uid:
|
||||||
return irc.pseudoclient.uid
|
return irc.pseudoclient.uid
|
||||||
if user == irc.pseudoclient.uid:
|
if user == irc.pseudoclient.uid:
|
||||||
return remoteirc.pseudoclient.uid
|
return remoteirc.pseudoclient.uid
|
||||||
|
except AttributeError: # Network hasn't been initialized yet?
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
u = relayusers[(irc.name, user)][remoteirc.name]
|
u = relayusers[(irc.name, user)][remoteirc.name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -386,6 +389,8 @@ def relayModes(irc, remoteirc, sender, channel, modes=None):
|
|||||||
if supported_char:
|
if supported_char:
|
||||||
supported_modes.append((prefix+supported_char, arg))
|
supported_modes.append((prefix+supported_char, arg))
|
||||||
log.debug('(%s) Relay mode: final modelist (sending to %s%s) is %s', irc.name, remoteirc.name, remotechan, supported_modes)
|
log.debug('(%s) Relay mode: final modelist (sending to %s%s) is %s', irc.name, remoteirc.name, remotechan, supported_modes)
|
||||||
|
# Don't send anything if there are no supported modes left after filtering.
|
||||||
|
if supported_modes:
|
||||||
# Check if the sender is a user; remember servers are allowed to set modes too.
|
# Check if the sender is a user; remember servers are allowed to set modes too.
|
||||||
if sender in irc.users:
|
if sender in irc.users:
|
||||||
u = getRemoteUser(irc, remoteirc, sender)
|
u = getRemoteUser(irc, remoteirc, sender)
|
||||||
|
Loading…
Reference in New Issue
Block a user