From 042d70a3b94ba8addbe7e484a14477ebf1f2599f Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Tue, 16 Aug 2022 08:25:22 +0200 Subject: [PATCH] Revert "Only return non-retired invites" This reverts commit 1150aa7f385b7d7cf5378297f3e17566d5aabcc6. --- syncapi/storage/postgres/invites_table.go | 5 ++--- syncapi/storage/sqlite3/invites_table.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/syncapi/storage/postgres/invites_table.go b/syncapi/storage/postgres/invites_table.go index 576b2cf7d..97001ae2c 100644 --- a/syncapi/storage/postgres/invites_table.go +++ b/syncapi/storage/postgres/invites_table.go @@ -20,12 +20,11 @@ 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 = ` @@ -57,7 +56,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 AND deleted = false" + + " WHERE target_user_id = $1 AND id > $2 AND id <= $3" + " ORDER BY id DESC" const selectMaxInviteIDSQL = "" + diff --git a/syncapi/storage/sqlite3/invites_table.go b/syncapi/storage/sqlite3/invites_table.go index 9f2812979..58ab8461e 100644 --- a/syncapi/storage/sqlite3/invites_table.go +++ b/syncapi/storage/sqlite3/invites_table.go @@ -20,12 +20,11 @@ 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 = ` @@ -52,7 +51,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 AND deleted = false" + + " WHERE target_user_id = $1 AND id > $2 AND id <= $3" + " ORDER BY id DESC" const selectMaxInviteIDSQL = "" +