aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/perform
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-10-11 16:04:02 +0200
committerGitHub <noreply@github.com>2022-10-11 16:04:02 +0200
commit3c1474f68f2ac5e564d2bd4bd15f01d2a73f2845 (patch)
tree05c5c35d4bae936e652c82c53228fbfac2a6aae7 /roomserver/internal/perform
parent0a9aebdf011921680e5b0646bf50d7900423aa69 (diff)
Fix `/get_missing_events` for rooms with `joined`/`invited` history_visibility (#2787)
Sytest was using a wrong `history_visibility` for `invited` (https://github.com/matrix-org/sytest/pull/1303), so `invited` was passing for the wrong reason (-> defaulted to `shared`, as `invite` wasn't understood). This change now handles missing events like Synapse, if a server isn't allowed to see the event, it gets a redacted version of it, making the `get_missing_events` tests pass.
Diffstat (limited to 'roomserver/internal/perform')
-rw-r--r--roomserver/internal/perform/perform_backfill.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/roomserver/internal/perform/perform_backfill.go b/roomserver/internal/perform/perform_backfill.go
index 69a07573..57e121ea 100644
--- a/roomserver/internal/perform/perform_backfill.go
+++ b/roomserver/internal/perform/perform_backfill.go
@@ -78,7 +78,7 @@ func (r *Backfiller) PerformBackfill(
}
// Scan the event tree for events to send back.
- resultNIDs, err := helpers.ScanEventTree(ctx, r.DB, info, front, visited, request.Limit, request.ServerName)
+ resultNIDs, redactEventIDs, err := helpers.ScanEventTree(ctx, r.DB, info, front, visited, request.Limit, request.ServerName)
if err != nil {
return err
}
@@ -95,6 +95,9 @@ func (r *Backfiller) PerformBackfill(
}
for _, event := range loadedEvents {
+ if _, ok := redactEventIDs[event.EventID()]; ok {
+ event.Redact()
+ }
response.Events = append(response.Events, event.Headered(info.RoomVersion))
}