summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-09-07 16:42:00 +0100
committerMatthew Hodgson <matthew@matrix.org>2018-09-07 16:42:00 +0100
commit671ff2cef60b2ffa4f55ce57e2de48360254978b (patch)
tree8252d42d9d7dd3c6091971a2751c06d2dff6c0bf
parentthinko (diff)
downloadsynapse-671ff2cef60b2ffa4f55ce57e2de48360254978b.tar.xz
fix thinkos
-rw-r--r--synapse/storage/roommember.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index 223beb7f32..a751ff723a 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -101,7 +101,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
                 summary['users'].append((to_ascii(r[0]), to_ascii(r[2])))
 
             sql = (
-                "SELECT count(*) FROM room_memberships as m"
+                "SELECT count(*), m.membership FROM room_memberships as m"
                 " INNER JOIN current_state_events as c"
                 " ON m.event_id = c.event_id "
                 " AND m.room_id = c.room_id "
@@ -111,9 +111,10 @@ class RoomMemberWorkerStore(EventsWorkerStore):
 
             txn.execute(sql, (room_id,))
             for r in txn:
+                summary = res.setdefault(to_ascii(r[1]), {})
                 summary['count'] = r[0]
 
-            return summary
+            return res
 
         return self.runInteraction("get_room_summary", f)