summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-09-12 16:43:49 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-09-12 16:43:49 +0100
commitaa525e4a634a2a5932995dab3faead5a1b91c5a7 (patch)
tree9ca27f1546469d12d7c971874ed4ff0c40e826d3
parentRevert recent changes to RoomMemberStore (diff)
downloadsynapse-aa525e4a634a2a5932995dab3faead5a1b91c5a7.tar.xz
More accurate docs / clearer paramter names in RoomMemberStore
-rw-r--r--synapse/storage/roommember.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index 9a393e2568..8357a0edd7 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -120,7 +120,7 @@ class RoomMemberStore(SQLBaseStore):
             membership_list (list): A list of synapse.api.constants.Membership
             values which the user must be in.
         Returns:
-            A list of dicts with "room_id" and "membership" keys.
+            A list of RoomMemberEvent objects
         """
         if not membership_list:
             return defer.succeed(None)
@@ -165,10 +165,11 @@ class RoomMemberStore(SQLBaseStore):
         defer.returnValue(results)
 
     @defer.inlineCallbacks
-    def user_rooms_intersect(self, user_list):
-        """ Checks whether a list of users share a room.
+    def user_rooms_intersect(self, user_id_list):
+        """ Checks whether all the users whose IDs are given in a list share a
+        room.
         """
-        user_list_clause = " OR ".join(["m.user_id = ?"] * len(user_list))
+        user_list_clause = " OR ".join(["m.user_id = ?"] * len(user_id_list))
         sql = (
             "SELECT m.room_id FROM room_memberships as m "
             "INNER JOIN current_state_events as c "
@@ -178,8 +179,8 @@ class RoomMemberStore(SQLBaseStore):
             "GROUP BY m.room_id HAVING COUNT(m.room_id) = ?"
         ) % {"clause": user_list_clause}
 
-        args = user_list
-        args.append(len(user_list))
+        args = list(user_id_list)
+        args.append(len(user_id_list))
 
         rows = yield self._execute(None, sql, *args)