diff options
author | Erik Johnston <erik@matrix.org> | 2021-05-05 16:49:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-05 16:49:34 +0100 |
commit | d0aee697ac0587c005bc1048f5036979331f1101 (patch) | |
tree | c0bf6d4529c11b59fde71533b4e06def8e196375 /synapse/storage/databases/main/roommember.py | |
parent | Docker healthcheck timings - add startup delay and changed interval (#9913) (diff) | |
download | synapse-d0aee697ac0587c005bc1048f5036979331f1101.tar.xz |
Use get_current_users_in_room from store and not StateHandler (#9910)
Diffstat (limited to 'synapse/storage/databases/main/roommember.py')
-rw-r--r-- | synapse/storage/databases/main/roommember.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/storage/databases/main/roommember.py b/synapse/storage/databases/main/roommember.py index 2a8532f8c1..5fc3bb5a7d 100644 --- a/synapse/storage/databases/main/roommember.py +++ b/synapse/storage/databases/main/roommember.py @@ -205,8 +205,12 @@ class RoomMemberWorkerStore(EventsWorkerStore): def _get_users_in_room_with_profiles(txn) -> Dict[str, ProfileInfo]: sql = """ - SELECT user_id, display_name, avatar_url FROM room_memberships - WHERE room_id = ? AND membership = ? + SELECT state_key, display_name, avatar_url 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 + AND m.user_id = c.state_key + WHERE c.type = 'm.room.member' AND c.room_id = ? AND m.membership = ? """ txn.execute(sql, (room_id, Membership.JOIN)) |