diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2021-01-13 14:32:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-13 14:32:49 +0000 |
commit | bb9e6a1281807ff76a67219a8cb59e1dadac0419 (patch) | |
tree | 7024adceaf4051bd1d80f753b3ebd82e049442c5 /syncapi/streams/stream_accountdata.go | |
parent | 55cfe391f726a06c6303a7bf71ffee28d00f9f33 (diff) |
Sync fixes (#1709)
* omitempty some fields in sync
* Add a few more
* Don't send push rules over and over again in incremental sync
* Further tweaks
Diffstat (limited to 'syncapi/streams/stream_accountdata.go')
-rw-r--r-- | syncapi/streams/stream_accountdata.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/syncapi/streams/stream_accountdata.go b/syncapi/streams/stream_accountdata.go index aa7f0937..105d8526 100644 --- a/syncapi/streams/stream_accountdata.go +++ b/syncapi/streams/stream_accountdata.go @@ -82,11 +82,6 @@ func (p *AccountDataStreamProvider) IncrementalSync( return from } - if len(dataTypes) == 0 { - // TODO: this fixes the sytest but is it the right thing to do? - dataTypes[""] = []string{"m.push_rules"} - } - // Iterate over the rooms for roomID, dataTypes := range dataTypes { // Request the missing data from the database @@ -114,7 +109,10 @@ func (p *AccountDataStreamProvider) IncrementalSync( } } else { if roomData, ok := dataRes.RoomAccountData[roomID][dataType]; ok { - joinData := req.Response.Rooms.Join[roomID] + joinData := *types.NewJoinResponse() + if existing, ok := req.Response.Rooms.Join[roomID]; ok { + joinData = existing + } joinData.AccountData.Events = append( joinData.AccountData.Events, gomatrixserverlib.ClientEvent{ |