Skip to content

Commit

Permalink
fix: push redis pkg (#1019)
Browse files Browse the repository at this point in the history
* fix: repeated modification session notification

* fix: repeated modification session notification

* fix: jpush return a nil pointer panic

* fix: push redis pkg

* fix: OANotification
  • Loading branch information
withchao authored Sep 7, 2023
1 parent 2cca15d commit 94a4199
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 10 additions & 13 deletions internal/api/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {

Check failure on line 55 in internal/api/msg.go

View workflow job for this annotation

GitHub Actions / lint

`(MessageApi).newUserSendMsgReq` - `c` is unused (unparam)
var newContent string
var err error
options := make(map[string]bool, 5)
switch params.ContentType {
case constant.Text:
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion internal/push/offlinepush/getui/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 94a4199

Please sign in to comment.