diff options
author | Erik Johnston <erik@matrix.org> | 2015-01-07 14:34:00 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-01-07 14:34:00 +0000 |
commit | bacaa215eb2e1c11e50bbc3fb0e43e28a463458b (patch) | |
tree | 27510a6358b8bc219ccd456622b963a3b394bee3 /synapse/handlers/room.py | |
parent | Merge branch 'hotfixes-v0.6.0a' (diff) | |
parent | Improve change log (diff) | |
download | synapse-bacaa215eb2e1c11e50bbc3fb0e43e28a463458b.tar.xz |
Merge branch 'release-v0.6.1' of github.com:matrix-org/synapse v0.6.1
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r-- | synapse/handlers/room.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index deefc3c11e..59719a1fae 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2014 OpenMarket Ltd +# Copyright 2014, 2015 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -245,14 +245,12 @@ class RoomMemberHandler(BaseHandler): self.distributor.declare("user_left_room") @defer.inlineCallbacks - def get_room_members(self, room_id, membership=Membership.JOIN): + def get_room_members(self, room_id): hs = self.hs - memberships = yield self.store.get_room_members( - room_id=room_id, membership=membership - ) + users = yield self.store.get_users_in_room(room_id) - defer.returnValue([hs.parse_userid(m.user_id) for m in memberships]) + defer.returnValue([hs.parse_userid(u) for u in users]) @defer.inlineCallbacks def fetch_room_distributions_into(self, room_id, localusers=None, @@ -531,11 +529,10 @@ class RoomListHandler(BaseHandler): def get_public_room_list(self): chunk = yield self.store.get_rooms(is_public=True) for room in chunk: - joined_members = yield self.store.get_room_members( + joined_users = yield self.store.get_users_in_room( room_id=room["room_id"], - membership=Membership.JOIN ) - room["num_joined_members"] = len(joined_members) + room["num_joined_members"] = len(joined_users) # FIXME (erikj): START is no longer a valid value defer.returnValue({"start": "START", "end": "END", "chunk": chunk}) |