0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 10:33:49 +01:00

get_room_members is unused now

This commit is contained in:
Mark Haines 2016-05-16 19:51:43 +01:00
parent 821306120a
commit 816df9f267
2 changed files with 0 additions and 36 deletions

View file

@ -137,24 +137,6 @@ class RoomMemberStore(SQLBaseStore):
return [r["user_id"] for r in rows] return [r["user_id"] for r in rows]
return self.runInteraction("get_users_in_room", f) return self.runInteraction("get_users_in_room", f)
def get_room_members(self, room_id, membership=None):
"""Retrieve the current room member list for a room.
Args:
room_id (str): The room to get the list of members.
membership (synapse.api.constants.Membership): The filter to apply
to this list, or None to return all members with some state
associated with this room.
Returns:
list of namedtuples representing the members in this room.
"""
return self.runInteraction(
"get_room_members",
self._get_members_events_txn,
room_id,
membership=membership,
).addCallback(self._get_events)
@cached() @cached()
def get_invited_rooms_for_user(self, user_id): def get_invited_rooms_for_user(self, user_id):
""" Get all the rooms the user is invited to """ Get all the rooms the user is invited to

View file

@ -70,12 +70,6 @@ class RoomMemberStoreTestCase(unittest.TestCase):
def test_one_member(self): def test_one_member(self):
yield self.inject_room_member(self.room, self.u_alice, Membership.JOIN) yield self.inject_room_member(self.room, self.u_alice, Membership.JOIN)
self.assertEquals(
[self.u_alice.to_string()],
[m.user_id for m in (
yield self.store.get_room_members(self.room.to_string())
)]
)
self.assertEquals( self.assertEquals(
[self.room.to_string()], [self.room.to_string()],
[m.room_id for m in ( [m.room_id for m in (
@ -85,18 +79,6 @@ class RoomMemberStoreTestCase(unittest.TestCase):
)] )]
) )
@defer.inlineCallbacks
def test_two_members(self):
yield self.inject_room_member(self.room, self.u_alice, Membership.JOIN)
yield self.inject_room_member(self.room, self.u_bob, Membership.JOIN)
self.assertEquals(
{self.u_alice.to_string(), self.u_bob.to_string()},
{m.user_id for m in (
yield self.store.get_room_members(self.room.to_string())
)}
)
@defer.inlineCallbacks @defer.inlineCallbacks
def test_room_hosts(self): def test_room_hosts(self):
yield self.inject_room_member(self.room, self.u_alice, Membership.JOIN) yield self.inject_room_member(self.room, self.u_alice, Membership.JOIN)