diff options
author | Neil Johnson <neil@matrix.org> | 2018-08-31 16:31:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-31 16:31:48 +0000 |
commit | 99178f86025f881b74b1a609a73d5920e701eddb (patch) | |
tree | ae140eb5def07a0ecf98fd4e0178107e3ba6113c /synapse/config | |
parent | Port storage/ to Python 3 (#3725) (diff) | |
parent | assert rather than warn (diff) | |
download | synapse-99178f86025f881b74b1a609a73d5920e701eddb.tar.xz |
Merge pull request #3777 from matrix-org/neilj/fix_register_user_registration
fix bug where preserved threepid user comes to sign up and server is …
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/server.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py index 2faf472189..c1c7c0105e 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -404,6 +404,23 @@ class ServerConfig(Config): " service on the given port.") +def is_threepid_reserved(config, threepid): + """Check the threepid against the reserved threepid config + Args: + config(ServerConfig) - to access server config attributes + threepid(dict) - The threepid to test for + + Returns: + boolean Is the threepid undertest reserved_user + """ + + for tp in config.mau_limits_reserved_threepids: + if (threepid['medium'] == tp['medium'] + and threepid['address'] == tp['address']): + return True + return False + + def read_gc_thresholds(thresholds): """Reads the three integer thresholds for garbage collection. Ensures that the thresholds are integers if thresholds are supplied. |