From 6c98aa76667752b70121f220b3cfc524e118eeb1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 11 Oct 2017 18:14:12 +0100 Subject: [PATCH] Fix IsEmpty to return the right thing --- .../matrix-org/dendrite/syncapi/types/types.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/syncapi/types/types.go b/src/github.com/matrix-org/dendrite/syncapi/types/types.go index 2f91c4563..d0b1c38ab 100644 --- a/src/github.com/matrix-org/dendrite/syncapi/types/types.go +++ b/src/github.com/matrix-org/dendrite/syncapi/types/types.go @@ -77,11 +77,11 @@ func NewResponse(pos StreamPosition) *Response { // IsEmpty returns true if the response is empty, i.e. used to decided whether // to return the response immediately to the client or to wait for more data. func (r *Response) IsEmpty() bool { - return len(r.Rooms.Join) > 0 || - len(r.Rooms.Invite) > 0 || - len(r.Rooms.Leave) > 0 || - len(r.AccountData.Events) > 0 || - len(r.Presence.Events) > 0 + return len(r.Rooms.Join) == 0 && + len(r.Rooms.Invite) == 0 && + len(r.Rooms.Leave) == 0 && + len(r.AccountData.Events) == 0 && + len(r.Presence.Events) == 0 } // JoinResponse represents a /sync response for a room which is under the 'join' key.