3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-11 12:42:34 +01:00

relay: ignore static extbans when looking up dynamic extban prefixes

This fixes #560, which was caused by relay confusing ban_all_registered ($a) with ban_account ($a:), since $a:account also starts with $a.
This commit is contained in:
James Lu 2017-12-07 11:05:39 -08:00
parent 6adeada598
commit 8fcb5f9df0

View File

@ -1002,8 +1002,9 @@ def get_supported_cmodes(irc, remoteirc, channel, modes):
"(name=%r; extban_name=%r) doesn't match any (static) extban on %s",
irc.name, supported_char, arg, name, extban_name, remoteirc.name)
mode_parse_aborted = True
elif arg.startswith(extban_prefix):
# This is a full extban with a prefix and some data.
elif extban_prefix.endswith(':') and arg.startswith(extban_prefix):
# This is a full extban with a prefix and some data. The assumption: all extbans with data
# have a prefix ending with : (as a delimiter)
if extban_name in remoteirc.extbans_matching:
# Chop off our prefix and apply the remote's.
arg = arg[len(extban_prefix):]