summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-08 12:11:36 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-08 12:15:29 -0700
commit76fe7d4eba334cee8b5c18ac26da709106dff1a2 (patch)
tree7048fb140aa290d902d82b2911347f71e9078ecf /synapse/handlers/room.py
parentHandle the case where we don't have a common ancestor (diff)
downloadsynapse-76fe7d4eba334cee8b5c18ac26da709106dff1a2.tar.xz
Added num_joined_users key to /publicRooms for each room. Show this information in the webclient.
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index a0d0f2af16..310cb46fe7 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -593,6 +593,12 @@ class RoomListHandler(BaseHandler):
     @defer.inlineCallbacks
     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(
+                room_id=room["room_id"],
+                membership=Membership.JOIN
+            )
+            room["num_joined_members"] = len(joined_members)
         # FIXME (erikj): START is no longer a valid value
         defer.returnValue({"start": "START", "end": "END", "chunk": chunk})