From d4e575f777e3951a0578cada37b4ec43c2036627 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 13 Jul 2022 11:43:37 +0800 Subject: [PATCH] Show group notification editor --- internal/rpc/group/group.go | 4 ++++ pkg/common/utils/utils.go | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index cd5200023..d2f03312f 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -250,6 +250,10 @@ func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJo utils.CopyStructFields(&groupNode, group) groupNode.CreateTime = uint32(group.CreateTime.Unix()) groupNode.NotificationUpdateTime = uint32(group.NotificationUpdateTime.Unix()) + if group.NotificationUpdateTime.Unix() < 0 { + groupNode.NotificationUpdateTime = 0 + } + groupNode.MemberCount = num groupNode.OwnerUserID = owner.UserID resp.GroupList = append(resp.GroupList, &groupNode) diff --git a/pkg/common/utils/utils.go b/pkg/common/utils/utils.go index ccbb08b01..c25614ad5 100644 --- a/pkg/common/utils/utils.go +++ b/pkg/common/utils/utils.go @@ -99,6 +99,9 @@ func GroupDBCopyOpenIM(dst *open_im_sdk.GroupInfo, src *db.Group) error { } dst.CreateTime = uint32(src.CreateTime.Unix()) dst.NotificationUpdateTime = uint32(src.NotificationUpdateTime.Unix()) + if src.NotificationUpdateTime.Unix() < 0 { + dst.NotificationUpdateTime = 0 + } return nil } @@ -119,7 +122,7 @@ func GroupMemberDBCopyOpenIM(dst *open_im_sdk.GroupMemberFullInfo, src *db.Group dst.AppMangerLevel = 1 } dst.JoinTime = int32(src.JoinTime.Unix()) - if src.MuteEndTime.Unix() < 0 { + if src.JoinTime.Unix() < 0 { dst.JoinTime = 0 return nil }