fix thinkos

This commit is contained in:
Matthew Hodgson 2018-09-07 16:42:00 +01:00
parent c5976d394a
commit 671ff2cef6

View file

@ -101,7 +101,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
summary['users'].append((to_ascii(r[0]), to_ascii(r[2]))) summary['users'].append((to_ascii(r[0]), to_ascii(r[2])))
sql = ( sql = (
"SELECT count(*) FROM room_memberships as m" "SELECT count(*), m.membership FROM room_memberships as m"
" INNER JOIN current_state_events as c" " INNER JOIN current_state_events as c"
" ON m.event_id = c.event_id " " ON m.event_id = c.event_id "
" AND m.room_id = c.room_id " " AND m.room_id = c.room_id "
@ -111,9 +111,10 @@ class RoomMemberWorkerStore(EventsWorkerStore):
txn.execute(sql, (room_id,)) txn.execute(sql, (room_id,))
for r in txn: for r in txn:
summary = res.setdefault(to_ascii(r[1]), {})
summary['count'] = r[0] summary['count'] = r[0]
return summary return res
return self.runInteraction("get_room_summary", f) return self.runInteraction("get_room_summary", f)