From 12a4c127530f33293cb974688842774931b6432a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 16 Aug 2022 19:15:54 +0800 Subject: [PATCH 1/3] notification --- internal/push/fcm/push.go | 4 ++-- internal/rpc/msg/send_msg.go | 4 ++-- pkg/common/constant/constant.go | 2 +- pkg/tools/{ => splitter}/tools.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename pkg/tools/{ => splitter}/tools.go (97%) diff --git a/internal/push/fcm/push.go b/internal/push/fcm/push.go index 7c1f55d00..99338e558 100644 --- a/internal/push/fcm/push.go +++ b/internal/push/fcm/push.go @@ -5,7 +5,7 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" - "Open_IM/pkg/tools" + "Open_IM/pkg/tools/splitter" "context" firebase "firebase.google.com/go" "firebase.google.com/go/messaging" @@ -62,7 +62,7 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string, } Success := 0 Fail := 0 - result := tools.NewSplitter(SinglePushCountLimit, Tokens).GetSplitResult() + result := splitter.NewSplitter(SinglePushCountLimit, Tokens).GetSplitResult() Msg := new(messaging.MulticastMessage) Msg.Notification = &messaging.Notification{} Msg.Notification.Body = detailContent diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 91d8ca1d3..d65f7b0ed 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -837,9 +837,9 @@ func Notification(n *NotificationMsg) { ex = config.Config.Notification.ConversationSetPrivate.OfflinePush.Ext reliabilityLevel = config.Config.Notification.ConversationSetPrivate.Conversation.ReliabilityLevel unReadCount = config.Config.Notification.ConversationSetPrivate.Conversation.UnreadCount - case constant.DeleteMessageNotification: + case constant.DeleteMessageNotification, constant.SuperGroupUpdateNotification: reliabilityLevel = constant.ReliableNotificationNoMsg - case constant.SuperGroupUpdateNotification, constant.ConversationUnreadNotification: + case constant.ConversationUnreadNotification: reliabilityLevel = constant.UnreliableNotification } switch reliabilityLevel { diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index b81cb07d6..016b83dcb 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -64,7 +64,6 @@ const ( FriendRemarkSetNotification = 1206 //set_friend_remark? BlackAddedNotification = 1207 //add_black BlackDeletedNotification = 1208 //remove_black - MsgDeleteNotification = 1209 ConversationOptChangeNotification = 1300 // change conversation opt @@ -100,6 +99,7 @@ const ( SuperGroupNotificationBegin = 1650 SuperGroupUpdateNotification = 1651 + MsgDeleteNotification = 1652 SuperGroupNotificationEnd = 1699 ConversationPrivateChatNotification = 1701 diff --git a/pkg/tools/tools.go b/pkg/tools/splitter/tools.go similarity index 97% rename from pkg/tools/tools.go rename to pkg/tools/splitter/tools.go index a3baa5f3e..40bd7dee2 100644 --- a/pkg/tools/tools.go +++ b/pkg/tools/splitter/tools.go @@ -1,4 +1,4 @@ -package tools +package splitter type SplitResult struct { Item []string From 487d9a6449ef976f1636ad1959e079929fca0fc0 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 16 Aug 2022 19:54:04 +0800 Subject: [PATCH 2/3] notification --- internal/rpc/group/group.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 95d91e993..a8bb41dc2 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -256,6 +256,9 @@ func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJo log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), v) continue } + if group.GroupType == constant.SuperGroup { + continue + } if group.Status == constant.GroupStatusDismissed { log.NewError(req.OperationID, "constant.GroupStatusDismissed ", group) continue From a38291fc177e484fe3debe537635ec6727b45d99 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 17 Aug 2022 10:18:01 +0800 Subject: [PATCH 3/3] notification --- internal/rpc/msg/send_msg.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index d65f7b0ed..9042a5033 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -837,9 +837,9 @@ func Notification(n *NotificationMsg) { ex = config.Config.Notification.ConversationSetPrivate.OfflinePush.Ext reliabilityLevel = config.Config.Notification.ConversationSetPrivate.Conversation.ReliabilityLevel unReadCount = config.Config.Notification.ConversationSetPrivate.Conversation.UnreadCount - case constant.DeleteMessageNotification, constant.SuperGroupUpdateNotification: + case constant.DeleteMessageNotification: reliabilityLevel = constant.ReliableNotificationNoMsg - case constant.ConversationUnreadNotification: + case constant.ConversationUnreadNotification, constant.SuperGroupUpdateNotification: reliabilityLevel = constant.UnreliableNotification } switch reliabilityLevel {