mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
No need for the extra join since membership
is built-in to current_state_events
(#15731)
This helps with the upstream `is_host_joined()` and `is_host_invited()` functions. `membership` was added to `current_state_events` in https://github.com/matrix-org/synapse/pull/5706 and forced in https://github.com/matrix-org/synapse/pull/13745
This commit is contained in:
parent
8bfded81f3
commit
9d911b0da6
1
changelog.d/15731.misc
Normal file
1
changelog.d/15731.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Remove redundant table join with `room_memberships` when doing a `is_host_joined()`/`is_host_invited()` call (`membership` is already part of the `current_state_events`).
|
@ -927,11 +927,10 @@ class RoomMemberWorkerStore(EventsWorkerStore, CacheInvalidationWorkerStore):
|
|||||||
raise Exception("Invalid host name")
|
raise Exception("Invalid host name")
|
||||||
|
|
||||||
sql = """
|
sql = """
|
||||||
SELECT state_key FROM current_state_events AS c
|
SELECT state_key FROM current_state_events
|
||||||
INNER JOIN room_memberships AS m USING (event_id)
|
WHERE membership = ?
|
||||||
WHERE m.membership = ?
|
|
||||||
AND type = 'm.room.member'
|
AND type = 'm.room.member'
|
||||||
AND c.room_id = ?
|
AND room_id = ?
|
||||||
AND state_key LIKE ?
|
AND state_key LIKE ?
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user