summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-08-28 13:41:29 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2019-08-28 13:41:29 +0100
commit38dac2774f14f1261a7c75456f1916f49eee3cb1 (patch)
treee1e50afe41bad359d4072c99cb1490770e7e4b54
parentsmall fixes and remove unnecessary Enum (diff)
downloadsynapse-38dac2774f14f1261a7c75456f1916f49eee3cb1.tar.xz
Warn user when the id_server they chose does not support any of the hs' desired lookup algos
-rw-r--r--synapse/handlers/room_member.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index d619ce60a3..98f7d86ec0 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -774,7 +774,7 @@ class RoomMemberHandler(object):
         lookup_pepper = hash_details["lookup_pepper"]
 
         # Check if any of the supported lookup algorithms are present
-        if str(LookupAlgorithm.SHA256) in supported_lookup_algorithms:
+        if LookupAlgorithm.SHA256 in supported_lookup_algorithms:
             # Perform a hashed lookup
             lookup_algorithm = LookupAlgorithm.SHA256
 
@@ -782,7 +782,7 @@ class RoomMemberHandler(object):
             to_hash = "%s %s %s" % (address, medium, lookup_pepper)
             lookup_value = sha256_and_url_safe_base64(to_hash)
 
-        elif str(LookupAlgorithm.NONE) in supported_lookup_algorithms:
+        elif LookupAlgorithm.NONE in supported_lookup_algorithms:
             # Perform a non-hashed lookup
             lookup_algorithm = LookupAlgorithm.NONE
 
@@ -796,7 +796,8 @@ class RoomMemberHandler(object):
                 id_server,
                 hash_details["algorithms"],
             )
-            return None
+            raise SynapseError(400, "Provided identity server does not support any v2 lookup "
+                                    "algorithms that this homeserver supports.")
 
         try:
             lookup_results = yield self.simple_http_client.post_json_get_json(