From 8f9882c84d11682bae94af3b34960452767754a7 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Tue, 14 Jun 2022 16:07:04 +0200 Subject: [PATCH] Store the history visibilty calculated by the roomserver --- syncapi/consumers/roomserver.go | 4 +++- syncapi/routing/messages.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/syncapi/consumers/roomserver.go b/syncapi/consumers/roomserver.go index f0ca2106f..328e1e9dd 100644 --- a/syncapi/consumers/roomserver.go +++ b/syncapi/consumers/roomserver.go @@ -240,6 +240,7 @@ func (s *OutputRoomEventConsumer) onNewRoomEvent( msg.RemovesStateEventIDs, msg.TransactionID, false, + msg.HistoryVisibility, ) if err != nil { // panic rather than continue with an inconsistent database @@ -289,7 +290,8 @@ func (s *OutputRoomEventConsumer) onOldRoomEvent( []string{}, // adds no state []string{}, // removes no state nil, // no transaction - ev.StateKey() != nil, // exclude from sync? + ev.StateKey() != nil, // exclude from sync?, + msg.HistoryVisibility, ) if err != nil { // panic rather than continue with an inconsistent database diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go index e55c661d6..617287535 100644 --- a/syncapi/routing/messages.go +++ b/syncapi/routing/messages.go @@ -578,6 +578,7 @@ func (r *messagesReq) backfill(roomID string, backwardsExtremities map[string][] []string{}, []string{}, nil, true, + gomatrixserverlib.HistoryVisibilityShared, ) if err != nil { return nil, err