From d892a88dbe96950b844f1bc3f6c00b63c030d459 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Sun, 2 Oct 2022 13:11:52 +0200 Subject: [PATCH] Make room summary tests pass again --- syncapi/types/types.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/syncapi/types/types.go b/syncapi/types/types.go index 162624577..af1237f67 100644 --- a/syncapi/types/types.go +++ b/syncapi/types/types.go @@ -475,8 +475,14 @@ func (jr JoinResponse) MarshalJSON() ([]byte, error) { if jr.Timeline != nil && len(jr.Timeline.Events) == 0 { a.Timeline = nil } - if jr.Summary != nil && len(jr.Summary.Heroes) == 0 { - a.Summary = nil + if jr.Summary != nil { + var nilPtr int + joinedEmpty := jr.Summary.JoinedMemberCount == nil || jr.Summary.JoinedMemberCount == &nilPtr + invitedEmpty := jr.Summary.InvitedMemberCount == nil || jr.Summary.InvitedMemberCount == &nilPtr + if joinedEmpty && invitedEmpty && len(jr.Summary.Heroes) == 0 { + a.Summary = nil + } + } if jr.UnreadNotifications != nil && jr.UnreadNotifications.NotificationCount == 0 && jr.UnreadNotifications.HighlightCount == 0 {