Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
No need for the extra join since membership is built-in to `current_s…
Browse files Browse the repository at this point in the history
…tate_events`

`current_state_events` was added in #5706
and #13745
  • Loading branch information
MadLittleMods committed Jun 6, 2023
1 parent d43c72a commit a23749e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,11 +927,10 @@ async def _check_host_room_membership(
raise Exception("Invalid host name")

sql = """
SELECT state_key FROM current_state_events AS c
INNER JOIN room_memberships AS m USING (event_id)
WHERE m.membership = ?
SELECT state_key FROM current_state_events
WHERE membership = ?
AND type = 'm.room.member'
AND c.room_id = ?
AND room_id = ?
AND state_key LIKE ?
LIMIT 1
"""
Expand Down

0 comments on commit a23749e

Please sign in to comment.