Remove dummy state event in history sync

It's not needed anymore as the relevant PR was merged, and Synapse 1.53
seems to include a regression which breaks sending non-member state events
(which seems to be fixed by matrix-org/synapse#12083).
This commit is contained in:
Tulir Asokan 2022-02-28 23:59:05 +02:00
parent 9730c5e570
commit a3ba1e3826

View file

@ -321,20 +321,8 @@ func (portal *Portal) backfill(source *User, messages []*waProto.WebMessageInfo)
firstMsgTimestamp := time.Unix(int64(messages[len(messages)-1].GetMessageTimestamp()), 0) firstMsgTimestamp := time.Unix(int64(messages[len(messages)-1].GetMessageTimestamp()), 0)
historyBatch.StateEventsAtStart = make([]*event.Event, 1) historyBatch.StateEventsAtStart = make([]*event.Event, 0)
newBatch.StateEventsAtStart = make([]*event.Event, 1) newBatch.StateEventsAtStart = make([]*event.Event, 0)
// TODO remove the dummy state events after https://github.com/matrix-org/synapse/pull/11188
emptyStr := ""
dummyStateEvent := event.Event{
Type: BackfillDummyStateEvent,
Sender: portal.MainIntent().UserID,
StateKey: &emptyStr,
Timestamp: firstMsgTimestamp.UnixMilli(),
Content: event.Content{},
}
historyBatch.StateEventsAtStart[0] = &dummyStateEvent
newBatch.StateEventsAtStart[0] = &dummyStateEvent
addedMembers := make(map[id.UserID]*event.MemberEventContent) addedMembers := make(map[id.UserID]*event.MemberEventContent)
addMember := func(puppet *Puppet) { addMember := func(puppet *Puppet) {