mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
Refactor code
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
"Open_IM/pkg/utils"
|
||||
"encoding/json"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
//message MemberInfoChangedTips{
|
||||
@@ -75,7 +76,11 @@ func FriendApplicationProcessedNotification(req *pbFriend.AddFriendResponseReq)
|
||||
}
|
||||
|
||||
var tips open_im_sdk.TipsComm
|
||||
tips.Detail, _ = json.Marshal(FriendApplicationProcessedTips)
|
||||
tips.Detail, err = proto.Marshal(&FriendApplicationProcessedTips)
|
||||
if err != nil {
|
||||
log.Error(req.CommID.OperationID, "Marshal failed ", err.Error(), FriendApplicationProcessedTips)
|
||||
return
|
||||
}
|
||||
tips.DefaultTips = fromUserNickname + " FriendApplicationProcessedNotification " + toUserNickname
|
||||
|
||||
var n NotificationMsg
|
||||
@@ -86,6 +91,11 @@ func FriendApplicationProcessedNotification(req *pbFriend.AddFriendResponseReq)
|
||||
n.MsgFrom = constant.SysMsgType
|
||||
n.OperationID = req.CommID.OperationID
|
||||
n.Content, _ = json.Marshal(tips)
|
||||
n.Content, err = proto.Marshal(&tips)
|
||||
if err != nil {
|
||||
log.Error(req.CommID.OperationID, "Marshal failed ", err.Error(), tips)
|
||||
return
|
||||
}
|
||||
Notification(&n)
|
||||
}
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType i
|
||||
type NotificationMsg struct {
|
||||
SendID string
|
||||
RecvID string
|
||||
Content []byte
|
||||
Content []byte // open_im_sdk.TipsComm
|
||||
MsgFrom int32
|
||||
ContentType int32
|
||||
SessionType int32
|
||||
|
||||
Reference in New Issue
Block a user