summary refs log tree commit diff
path: root/synapse/util/threepids.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-09-14 11:02:37 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-09-14 11:02:37 +0100
commit003c2ab629ac23e5a789b8152f45f999a21dcfb2 (patch)
tree389f4e154384a4aea61aff018c0027f89b5179d0 /synapse/util/threepids.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentUse direct references for some configuration variables (#10798) (diff)
downloadsynapse-003c2ab629ac23e5a789b8152f45f999a21dcfb2.tar.xz
Merge branch 'release-v1.43' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/util/threepids.py')
-rw-r--r--synapse/util/threepids.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/util/threepids.py b/synapse/util/threepids.py

index a1cf1960b0..baa9190a9a 100644 --- a/synapse/util/threepids.py +++ b/synapse/util/threepids.py
@@ -14,6 +14,10 @@ import logging import re +import typing + +if typing.TYPE_CHECKING: + from synapse.server import HomeServer logger = logging.getLogger(__name__) @@ -28,13 +32,13 @@ logger = logging.getLogger(__name__) MAX_EMAIL_ADDRESS_LENGTH = 500 -def check_3pid_allowed(hs, medium, address): +def check_3pid_allowed(hs: "HomeServer", medium: str, address: str) -> bool: """Checks whether a given format of 3PID is allowed to be used on this HS Args: - hs (synapse.server.HomeServer): server - medium (str): 3pid medium - e.g. email, msisdn - address (str): address within that medium (e.g. "wotan@matrix.org") + hs: server + medium: 3pid medium - e.g. email, msisdn + address: address within that medium (e.g. "wotan@matrix.org") msisdns need to first have been canonicalised Returns: bool: whether the 3PID medium/address is allowed to be added to this HS