summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-06-15 10:00:28 +0100
committerErik Johnston <erik@matrix.org>2017-06-15 10:17:21 +0100
commita9d6fa8b2b31096b8f9fdb01b8fb5a2c6386e61f (patch)
tree015ca81db72d0079d39bce18ad82b0fb53f71c5c /synapse/rest/client
parentImplement updating users who share rooms on the fly (diff)
downloadsynapse-a9d6fa8b2b31096b8f9fdb01b8fb5a2c6386e61f.tar.xz
Include users who share room with requester in user directory
Diffstat (limited to 'synapse/rest/client')
-rw-r--r--synapse/rest/client/v2_alpha/user_directory.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/rest/client/v2_alpha/user_directory.py b/synapse/rest/client/v2_alpha/user_directory.py
index 17d3dffc8f..6e012da4aa 100644
--- a/synapse/rest/client/v2_alpha/user_directory.py
+++ b/synapse/rest/client/v2_alpha/user_directory.py
@@ -55,7 +55,9 @@ class UserDirectorySearchRestServlet(RestServlet):
                     ]
                 }
         """
-        yield self.auth.get_user_by_req(request, allow_guest=False)
+        requester = yield self.auth.get_user_by_req(request, allow_guest=False)
+        user_id = requester.user.to_string()
+
         body = parse_json_object_from_request(request)
 
         limit = body.get("limit", 10)
@@ -66,7 +68,9 @@ class UserDirectorySearchRestServlet(RestServlet):
         except:
             raise SynapseError(400, "`search_term` is required field")
 
-        results = yield self.user_directory_handler.search_users(search_term, limit)
+        results = yield self.user_directory_handler.search_users(
+            user_id, search_term, limit,
+        )
 
         defer.returnValue((200, results))