0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-06-02 20:49:04 +02:00

Only return non-retired invites

This commit is contained in:
Till Faelligen 2022-08-16 08:06:23 +02:00
parent bcdbd5c00a
commit 1150aa7f38
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E
2 changed files with 6 additions and 4 deletions

View file

@ -20,11 +20,12 @@ import (
"database/sql"
"encoding/json"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/syncapi/storage/tables"
"github.com/matrix-org/dendrite/syncapi/types"
"github.com/matrix-org/gomatrixserverlib"
)
const inviteEventsSchema = `
@ -56,7 +57,7 @@ const deleteInviteEventSQL = "" +
const selectInviteEventsInRangeSQL = "" +
"SELECT room_id, headered_event_json, deleted FROM syncapi_invite_events" +
" WHERE target_user_id = $1 AND id > $2 AND id <= $3" +
" WHERE target_user_id = $1 AND id > $2 AND id <= $3 AND deleted = false" +
" ORDER BY id DESC"
const selectMaxInviteIDSQL = "" +

View file

@ -20,11 +20,12 @@ import (
"database/sql"
"encoding/json"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/syncapi/storage/tables"
"github.com/matrix-org/dendrite/syncapi/types"
"github.com/matrix-org/gomatrixserverlib"
)
const inviteEventsSchema = `
@ -51,7 +52,7 @@ const deleteInviteEventSQL = "" +
const selectInviteEventsInRangeSQL = "" +
"SELECT room_id, headered_event_json, deleted FROM syncapi_invite_events" +
" WHERE target_user_id = $1 AND id > $2 AND id <= $3" +
" WHERE target_user_id = $1 AND id > $2 AND id <= $3 AND deleted = false" +
" ORDER BY id DESC"
const selectMaxInviteIDSQL = "" +