This commit is contained in:
Neil Alexander 2021-01-29 10:05:38 +00:00
parent fb11f70162
commit 8fa5039136
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 5 additions and 3 deletions

View file

@ -84,7 +84,7 @@ const selectCurrentStateSQL = "" +
" AND ( $4::text[] IS NULL OR type LIKE ANY($4) )" + " AND ( $4::text[] IS NULL OR type LIKE ANY($4) )" +
" AND ( $5::text[] IS NULL OR NOT(type LIKE ANY($5)) )" + " AND ( $5::text[] IS NULL OR NOT(type LIKE ANY($5)) )" +
" AND ( $6::bool IS NULL OR contains_url = $6 )" + " AND ( $6::bool IS NULL OR contains_url = $6 )" +
" AND NOT (event_id = ANY($7))" + " AND event_id != ANY($7)" +
" LIMIT $8" " LIMIT $8"
const selectJoinedUsersSQL = "" + const selectJoinedUsersSQL = "" +

View file

@ -225,8 +225,10 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
// Get the event IDs of the stream events we fetched. There's no point in us // Get the event IDs of the stream events we fetched. There's no point in us
excludingEventIDs := make([]string, 0, len(recentStreamEvents)) excludingEventIDs := make([]string, 0, len(recentStreamEvents))
for _, eventID := range recentStreamEvents { for _, event := range recentStreamEvents {
excludingEventIDs = append(excludingEventIDs, eventID.EventID()) if event.StateKey() != nil {
excludingEventIDs = append(excludingEventIDs, event.EventID())
}
} }
stateEvents, err := p.DB.CurrentState(ctx, roomID, stateFilter, excludingEventIDs) stateEvents, err := p.DB.CurrentState(ctx, roomID, stateFilter, excludingEventIDs)