aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/sqlite3/invites_table.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/storage/sqlite3/invites_table.go')
-rw-r--r--syncapi/storage/sqlite3/invites_table.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/syncapi/storage/sqlite3/invites_table.go b/syncapi/storage/sqlite3/invites_table.go
index 45862efb..7da86683 100644
--- a/syncapi/storage/sqlite3/invites_table.go
+++ b/syncapi/storage/sqlite3/invites_table.go
@@ -150,6 +150,14 @@ func (s *inviteEventsStatements) SelectInviteEventsInRange(
return nil, nil, err
}
+ // if we have seen this room before, it has a higher stream position and hence takes priority
+ // because the query is ORDER BY id DESC so drop them
+ _, isRetired := retired[roomID]
+ _, isInvited := result[roomID]
+ if isRetired || isInvited {
+ continue
+ }
+
var event gomatrixserverlib.HeaderedEvent
if err := json.Unmarshal(eventJSON, &event); err != nil {
return nil, nil, err