summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-01-10 15:15:48 +0000
committerGitHub <noreply@github.com>2018-01-10 15:15:48 +0000
commitb9e4a979229893e635d3286ad8711979693d41fb (patch)
treee435b829ac116dae520a20e0f00faa23009a1488 /synapse/handlers
parentMerge pull request #2770 from matrix-org/rav/fix_request_metrics (diff)
parentfix order of operations derp and also use `.get` to default to {} (diff)
downloadsynapse-b9e4a979229893e635d3286ad8711979693d41fb.tar.xz
Merge pull request #2772 from matrix-org/t3chguy/patch-1
Fix publicised groups GET API (singular) over federation
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/groups_local.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/groups_local.py b/synapse/handlers/groups_local.py
index 7e5d3f148d..e4d0cc8b02 100644
--- a/synapse/handlers/groups_local.py
+++ b/synapse/handlers/groups_local.py
@@ -383,11 +383,12 @@ class GroupsLocalHandler(object):
 
             defer.returnValue({"groups": result})
         else:
-            result = yield self.transport_client.get_publicised_groups_for_user(
-                get_domain_from_id(user_id), user_id
+            bulk_result = yield self.transport_client.bulk_get_publicised_groups(
+                get_domain_from_id(user_id), [user_id],
             )
+            result = bulk_result.get("users", {}).get(user_id)
             # TODO: Verify attestations
-            defer.returnValue(result)
+            defer.returnValue({"groups": result})
 
     @defer.inlineCallbacks
     def bulk_get_publicised_groups(self, user_ids, proxy=True):