From 671ff2cef60b2ffa4f55ce57e2de48360254978b Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 7 Sep 2018 16:42:00 +0100 Subject: [PATCH] fix thinkos --- synapse/storage/roommember.py | 5 +++-- 1 file 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)