From a7984645e829481d6da1bc2b7f8783ded45af260 Mon Sep 17 00:00:00 2001 From: PiotrKozimor <37144818+PiotrKozimor@users.noreply.github.com> Date: Wed, 2 Nov 2022 15:48:00 +0100 Subject: [PATCH] Fix streaming position in multiroom feature (#47) --- syncapi/sync/requestpool.go | 2 +- syncapi/types/types.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/syncapi/sync/requestpool.go b/syncapi/sync/requestpool.go index 77fdebb10..1733a15b0 100644 --- a/syncapi/sync/requestpool.go +++ b/syncapi/sync/requestpool.go @@ -505,7 +505,7 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi. func(snapshot storage.DatabaseTransaction) types.StreamPosition { return rp.streams.MultiRoomStreamProvider.IncrementalSync( syncReq.Context, snapshot, syncReq, - syncReq.Since.PresencePosition, rp.Notifier.CurrentPosition().PresencePosition, + syncReq.Since.MultiRoomDataPosition, rp.Notifier.CurrentPosition().MultiRoomDataPosition, ) }, ), diff --git a/syncapi/types/types.go b/syncapi/types/types.go index 442e3400c..3488461a6 100644 --- a/syncapi/types/types.go +++ b/syncapi/types/types.go @@ -410,7 +410,8 @@ func (r *Response) HasUpdates() bool { len(r.Rooms.Peek) > 0 || len(r.ToDevice.Events) > 0 || len(r.DeviceLists.Changed) > 0 || - len(r.DeviceLists.Left) > 0) + len(r.DeviceLists.Left) > 0) || + len(r.MultiRoom) > 0 } // NewResponse creates an empty response with initialised maps.