mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-12 21:22:36 +01:00
relay: when filtering modes, ignore internal mode-type lists (modenames starting with *)
This commit is contained in:
parent
a8b16d9724
commit
4ce377944c
@ -475,10 +475,14 @@ def relayModes(irc, remoteirc, sender, channel, modes=None):
|
|||||||
for name, m in irc.cmodes.items():
|
for name, m in irc.cmodes.items():
|
||||||
supported_char = None
|
supported_char = None
|
||||||
if modechar == m:
|
if modechar == m:
|
||||||
|
if name.startswith('*'):
|
||||||
|
# This internally is just used for storing which modes
|
||||||
|
# are which type; ignore them.
|
||||||
|
continue
|
||||||
if name not in whitelisted_cmodes:
|
if name not in whitelisted_cmodes:
|
||||||
log.debug("(%s) Relay mode: skipping mode (%r, %r) because "
|
log.debug("(%s) Relay mode: skipping mode %r (%r, %r) because "
|
||||||
"it isn't a whitelisted (safe) mode for relay.",
|
"it isn't a whitelisted (safe) cmode for relay.",
|
||||||
irc.name, modechar, arg)
|
irc.name, name, modechar, arg)
|
||||||
break
|
break
|
||||||
if modechar in irc.prefixmodes:
|
if modechar in irc.prefixmodes:
|
||||||
# This is a prefix mode (e.g. +o). We must coerse the argument
|
# This is a prefix mode (e.g. +o). We must coerse the argument
|
||||||
@ -523,11 +527,15 @@ def getSupportedUmodes(irc, remoteirc, modes):
|
|||||||
arg = modepair[1]
|
arg = modepair[1]
|
||||||
for name, m in irc.umodes.items():
|
for name, m in irc.umodes.items():
|
||||||
supported_char = None
|
supported_char = None
|
||||||
|
if name.startswith('*'):
|
||||||
|
# This internally is just used for storing which modes
|
||||||
|
# are which type; ignore them.
|
||||||
|
continue
|
||||||
if modechar == m:
|
if modechar == m:
|
||||||
if name not in whitelisted_umodes:
|
if name not in whitelisted_umodes:
|
||||||
log.debug("(%s) getSupportedUmodes: skipping mode (%r, %r) because "
|
log.debug("(%s) getSupportedUmodes: skipping mode %r (%r, %r) because "
|
||||||
"it isn't a whitelisted (safe) mode for relay.",
|
"it isn't a whitelisted (safe) umode for relay.",
|
||||||
irc.name, modechar, arg)
|
irc.name, name, modechar, arg)
|
||||||
break
|
break
|
||||||
supported_char = remoteirc.umodes.get(name)
|
supported_char = remoteirc.umodes.get(name)
|
||||||
if supported_char:
|
if supported_char:
|
||||||
|
Loading…
Reference in New Issue
Block a user