From 94a41998552aa69b40a736f798c380a0c3074784 Mon Sep 17 00:00:00 2001 From: withchao <48119764+withchao@users.noreply.github.com> Date: Thu, 7 Sep 2023 16:35:50 +0800 Subject: [PATCH] fix: push redis pkg (#1019) * fix: repeated modification session notification * fix: repeated modification session notification * fix: jpush return a nil pointer panic * fix: push redis pkg * fix: OANotification --- internal/api/msg.go | 23 ++++++++++------------- internal/push/offlinepush/getui/push.go | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/internal/api/msg.go b/internal/api/msg.go index 726889d56..e5a49199f 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -15,14 +15,12 @@ package api import ( + "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/tools/mcontext" "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" "github.com/mitchellh/mapstructure" - "google.golang.org/protobuf/proto" - - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msg" @@ -56,7 +54,6 @@ func (MessageApi) SetOptions(options map[string]bool, value bool) { func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg) *msg.SendMsgReq { var newContent string - var err error options := make(map[string]bool, 5) switch params.ContentType { case constant.Text: @@ -106,14 +103,14 @@ func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg) OfflinePushInfo: params.OfflinePushInfo, }, } - if params.ContentType == constant.OANotification { - var tips sdkws.TipsComm - tips.JsonDetail = utils.StructToJsonString(params.Content) - pbData.MsgData.Content, err = proto.Marshal(&tips) - if err != nil { - log.ZError(c, "Marshal failed ", err, "tips", tips.String()) - } - } + //if params.ContentType == constant.OANotification { + // var tips sdkws.TipsComm + // tips.JsonDetail = utils.StructToJsonString(params.Content) + // pbData.MsgData.Content, err = proto.Marshal(&tips) + // if err != nil { + // log.ZError(c, "Marshal failed ", err, "tips", tips.String()) + // } + //} return &pbData } diff --git a/internal/push/offlinepush/getui/push.go b/internal/push/offlinepush/getui/push.go index 1098dacae..b784af029 100644 --- a/internal/push/offlinepush/getui/push.go +++ b/internal/push/offlinepush/getui/push.go @@ -23,7 +23,7 @@ import ( "sync" "time" - "github.com/go-redis/redis" + "github.com/redis/go-redis/v9" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log"