From ce562d96f6a3f8918cd9296fe496f31a2c25689f Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 18 Oct 2017 10:36:45 +0100 Subject: [PATCH] Don't add empty room entries to sync responses (#312) --- .../matrix-org/dendrite/syncapi/storage/syncserver.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/syncapi/storage/syncserver.go b/src/github.com/matrix-org/dendrite/syncapi/storage/syncserver.go index 8e4c24e3c..1a18d9374 100644 --- a/src/github.com/matrix-org/dendrite/syncapi/storage/syncserver.go +++ b/src/github.com/matrix-org/dendrite/syncapi/storage/syncserver.go @@ -411,6 +411,11 @@ func (d *SyncServerDatabase) addRoomDeltaToResponse( recentEvents := streamEventsToEvents(recentStreamEvents) delta.stateEvents = removeDuplicates(delta.stateEvents, recentEvents) // roll back + // Don't bother appending empty room entries + if len(recentEvents) == 0 && len(delta.stateEvents) == 0 { + return nil + } + switch delta.membership { case "join": jr := types.NewJoinResponse()