mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 01:13:10 -06:00
Fix IsEmpty to return the right thing
This commit is contained in:
parent
edc8c5ae61
commit
6c98aa7666
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue