Experimental hack

This commit is contained in:
Neil Alexander 2020-10-22 11:15:38 +01:00
parent 46690a7c86
commit 6bb21b53cd
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -189,14 +189,20 @@ func (s *OutputRoomEventConsumer) onOldRoomEvent(
) error {
ev := msg.Event
// TODO: The state key check when excluding from sync is designed
// to stop us from lying to clients with old state, whilst still
// allowing normal timeline events through. This is an absolute
// hack but until we have some better strategy for dealing with
// old events in the sync API, this should at least prevent us
// from confusing clients into thinking they've joined/left rooms.
pduPos, err := s.db.WriteEvent(
ctx,
&ev,
[]gomatrixserverlib.HeaderedEvent{},
[]string{}, // adds no state
[]string{}, // removes no state
nil, // no transaction
true, // excluded from sync
[]string{}, // adds no state
[]string{}, // removes no state
nil, // no transaction
ev.StateKey() != nil, // exclude from sync?
)
if err != nil {
// panic rather than continue with an inconsistent database