mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 09:31:35 +03:00
Check shadow_hs as well as hs during 3pid reg
This commit is contained in:
parent
70e039c7ae
commit
9b13038d05
1 changed files with 8 additions and 6 deletions
|
@ -43,17 +43,19 @@ def check_3pid_allowed(hs, medium, address):
|
|||
{'medium': medium, 'address': address}
|
||||
)
|
||||
|
||||
# Assume false if invalid response
|
||||
if 'hs' not in data:
|
||||
# Check for invalid response
|
||||
if 'hs' not in data and 'shadow_hs' not in data:
|
||||
defer.returnValue(False)
|
||||
|
||||
# Check if this user is intended to register for this homeserver
|
||||
if data['hs'] != hs.config.server_name and data['shadow_hs'] != hs.config.server_name:
|
||||
defer.returnValue(False)
|
||||
|
||||
if data.get('requires_invite', False) and data.get('invited', False) == False:
|
||||
# Requires an invite but hasn't been invited
|
||||
defer.returnValue(False)
|
||||
if hs.config.allow_invited_3pids and data.get('invited'):
|
||||
|
||||
defer.returnValue(True)
|
||||
else:
|
||||
defer.returnValue(data['hs'] == hs.config.server_name)
|
||||
|
||||
if hs.config.allowed_local_3pids:
|
||||
for constraint in hs.config.allowed_local_3pids:
|
||||
|
|
Loading…
Reference in a new issue