mirror of
https://github.com/element-hq/synapse
synced 2024-09-01 19:10:21 +00:00
fix PR nitpicking
This commit is contained in:
parent
293380bef7
commit
8fe253f19b
1 changed files with 6 additions and 3 deletions
|
@ -27,13 +27,16 @@ def check_3pid_allowed(hs, medium, address):
|
||||||
medium (str): 3pid medium - e.g. email, msisdn
|
medium (str): 3pid medium - e.g. email, msisdn
|
||||||
address (str): address within that medium (e.g. "wotan@matrix.org")
|
address (str): address within that medium (e.g. "wotan@matrix.org")
|
||||||
msisdns need to first have been canonicalised
|
msisdns need to first have been canonicalised
|
||||||
|
Returns:
|
||||||
|
bool: whether the 3PID medium/address is allowed to be added to this HS
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if hs.config.allowed_local_3pids:
|
if hs.config.allowed_local_3pids:
|
||||||
for constraint in hs.config.allowed_local_3pids:
|
for constraint in hs.config.allowed_local_3pids:
|
||||||
logger.debug("Checking 3PID %s (%s) against %s (%s)" % (
|
logger.debug(
|
||||||
address, medium, constraint['pattern'], constraint['medium']
|
"Checking 3PID %s (%s) against %s (%s)",
|
||||||
))
|
address, medium, constraint['pattern'], constraint['medium'],
|
||||||
|
)
|
||||||
if (
|
if (
|
||||||
medium == constraint['medium'] and
|
medium == constraint['medium'] and
|
||||||
re.match(constraint['pattern'], address)
|
re.match(constraint['pattern'], address)
|
||||||
|
|
Loading…
Reference in a new issue