From 0b8f4c328ba68bd7d8be6395de95ffd685d9dfa4 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 29 Sep 2020 17:13:58 +0100 Subject: Add argument specifying whether 3pid check is happening during registration --- synapse/util/threepids.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'synapse/util/threepids.py') diff --git a/synapse/util/threepids.py b/synapse/util/threepids.py index c7459802fd..47327360f8 100644 --- a/synapse/util/threepids.py +++ b/synapse/util/threepids.py @@ -19,7 +19,7 @@ import re logger = logging.getLogger(__name__) -async def check_3pid_allowed(hs, medium, address): +async def check_3pid_allowed(hs, medium, address, during_registration: bool = False): """Checks whether a given format of 3PID is allowed to be used on this HS Args: @@ -27,6 +27,8 @@ async def check_3pid_allowed(hs, medium, address): medium (str): 3pid medium - e.g. email, msisdn address (str): address within that medium (e.g. "wotan@matrix.org") msisdns need to first have been canonicalised + during_registration: Whether this request has been made while registering a new + user. Returns: bool: whether the 3PID medium/address is allowed to be added to this HS """ -- cgit 1.5.1