From 5fa0046168fd4714a63a66cc76cc47af481507da Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 21 Aug 2019 13:11:08 +0200 Subject: [PATCH 1/2] Have 'mappings' contain medium as well as address --- sydent/http/servlets/lookupv2servlet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sydent/http/servlets/lookupv2servlet.py b/sydent/http/servlets/lookupv2servlet.py index 4105ecb1..4d2bb76a 100644 --- a/sydent/http/servlets/lookupv2servlet.py +++ b/sydent/http/servlets/lookupv2servlet.py @@ -104,7 +104,8 @@ def render_POST(self, request): medium_address_mxid_tuples = self.globalAssociationStore.getMxids(medium_address_tuples) # Return a dictionary of lookup_string: mxid values - return {'mappings': {x[1]: x[2] for x in medium_address_mxid_tuples}} + return {'mappings': { + "%s %s" % (x[1], x[0]): x[2] for x in medium_address_mxid_tuples}} elif algorithm == "sha256": # Lookup using SHA256 with URL-safe base64 encoding From 59f4af22b02eb38a303575297aae54dd160f145c Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 21 Aug 2019 13:18:30 +0200 Subject: [PATCH 2/2] Nicer spacing --- sydent/http/servlets/lookupv2servlet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sydent/http/servlets/lookupv2servlet.py b/sydent/http/servlets/lookupv2servlet.py index 4d2bb76a..833cee85 100644 --- a/sydent/http/servlets/lookupv2servlet.py +++ b/sydent/http/servlets/lookupv2servlet.py @@ -104,8 +104,8 @@ def render_POST(self, request): medium_address_mxid_tuples = self.globalAssociationStore.getMxids(medium_address_tuples) # Return a dictionary of lookup_string: mxid values - return {'mappings': { - "%s %s" % (x[1], x[0]): x[2] for x in medium_address_mxid_tuples}} + return {'mappings': {"%s %s" % (x[1], x[0]): x[2] + for x in medium_address_mxid_tuples}} elif algorithm == "sha256": # Lookup using SHA256 with URL-safe base64 encoding