From 3dba5495a6c56a36f079b68206b4a49e430889f0 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 4 Jul 2023 18:25:38 +0800 Subject: [PATCH] feat: group notification show to conversation --- internal/rpc/group/db_map.go | 8 ++++++-- internal/rpc/group/group.go | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/rpc/group/db_map.go b/internal/rpc/group/db_map.go index 7eb9ff650..01e3a2e2c 100644 --- a/internal/rpc/group/db_map.go +++ b/internal/rpc/group/db_map.go @@ -1,19 +1,23 @@ package group import ( + "context" + "github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext" "time" pbGroup "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" ) -func UpdateGroupInfoMap(group *sdkws.GroupInfoForSet) map[string]any { +func UpdateGroupInfoMap(ctx context.Context, group *sdkws.GroupInfoForSet) map[string]any { m := make(map[string]any) if group.GroupName != "" { m["name"] = group.GroupName } if group.Notification != "" { - m["Notification"] = group.Notification + m["notification"] = group.Notification + m["notification_update_time"] = time.Now() + m["notification_user_id"] = mcontext.GetOpUserID(ctx) } if group.Introduction != "" { m["introduction"] = group.Introduction diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 8757764c5..efe5e7276 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -846,7 +846,7 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf if err != nil { return nil, err } - data := UpdateGroupInfoMap(req.GroupInfoForSet) + data := UpdateGroupInfoMap(ctx, req.GroupInfoForSet) if len(data) == 0 { return resp, nil }