mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-09-09 13:21:55 +00:00
Make event stream storage return all membership events about the user, regardless of if they were in the room or not.
This commit is contained in:
parent
7371e68f55
commit
ebd3c41ede
@ -151,10 +151,12 @@ class StreamStore(SQLBaseStore):
|
|||||||
"WHERE m.user_id = ?"
|
"WHERE m.user_id = ?"
|
||||||
)
|
)
|
||||||
|
|
||||||
invites_sql = (
|
# We also want to get any membership events about that user, e.g.
|
||||||
|
# invites or leave notifications.
|
||||||
|
membership_sql = (
|
||||||
"SELECT m.event_id FROM room_memberships as m "
|
"SELECT m.event_id FROM room_memberships as m "
|
||||||
"INNER JOIN current_state_events as c ON m.event_id = c.event_id "
|
"INNER JOIN current_state_events as c ON m.event_id = c.event_id "
|
||||||
"WHERE m.user_id = ? AND m.membership = ?"
|
"WHERE m.user_id = ? "
|
||||||
)
|
)
|
||||||
|
|
||||||
if limit:
|
if limit:
|
||||||
@ -178,13 +180,13 @@ class StreamStore(SQLBaseStore):
|
|||||||
"ORDER BY stream_ordering ASC LIMIT %(limit)d "
|
"ORDER BY stream_ordering ASC LIMIT %(limit)d "
|
||||||
) % {
|
) % {
|
||||||
"current": current_room_membership_sql,
|
"current": current_room_membership_sql,
|
||||||
"invites": invites_sql,
|
"invites": membership_sql,
|
||||||
"limit": limit
|
"limit": limit
|
||||||
}
|
}
|
||||||
|
|
||||||
rows = yield self._execute_and_decode(
|
rows = yield self._execute_and_decode(
|
||||||
sql,
|
sql,
|
||||||
user_id, user_id, Membership.INVITE, from_id, to_id
|
user_id, user_id, from_id, to_id
|
||||||
)
|
)
|
||||||
|
|
||||||
ret = [self._parse_event_from_row(r) for r in rows]
|
ret = [self._parse_event_from_row(r) for r in rows]
|
||||||
|
Loading…
Reference in New Issue
Block a user