diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-18 14:31:47 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-18 14:31:47 +0100 |
commit | 335e5d131c90b82d1e7aa3955079f549fc211540 (patch) | |
tree | e21eae5ca01c2ab157e44eca2f8c2efe99735f23 /synapse/storage/roommember.py | |
parent | Merge branch 'release-v0.3.0' of github.com:matrix-org/synapse (diff) | |
parent | Merge branch 'develop' into test-sqlite-memory (diff) | |
download | synapse-335e5d131c90b82d1e7aa3955079f549fc211540.tar.xz |
Merge branch 'test-sqlite-memory' of github.com:matrix-org/synapse into develop
Conflicts: tests/handlers/test_profile.py
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r-- | synapse/storage/roommember.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index 676b2f2653..04b4067d03 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -149,7 +149,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) @@ -198,10 +198,11 @@ class RoomMemberStore(SQLBaseStore): return 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 " @@ -211,8 +212,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) |