|
|
|
@ -71,32 +71,34 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
|
|
|
|
bCustomContent, _ := json.Marshal(customContent)
|
|
|
|
|
jsonCustomContent := string(bCustomContent)
|
|
|
|
|
var content string
|
|
|
|
|
switch pushMsg.MsgData.ContentType {
|
|
|
|
|
case constant.Text:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Text]
|
|
|
|
|
case constant.Picture:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Picture]
|
|
|
|
|
case constant.Voice:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Voice]
|
|
|
|
|
case constant.Video:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Video]
|
|
|
|
|
case constant.File:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.File]
|
|
|
|
|
case constant.AtText:
|
|
|
|
|
a := AtContent{}
|
|
|
|
|
_ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a)
|
|
|
|
|
if utils.IsContain(v.RecvID, a.AtUserList) {
|
|
|
|
|
content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common]
|
|
|
|
|
} else {
|
|
|
|
|
content = constant.ContentType2PushContent[constant.GroupMsg]
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Common]
|
|
|
|
|
}
|
|
|
|
|
if pushMsg.MsgData.OfflinePushInfo != nil {
|
|
|
|
|
content = pushMsg.MsgData.OfflinePushInfo.Title
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
switch pushMsg.MsgData.ContentType {
|
|
|
|
|
case constant.Text:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Text]
|
|
|
|
|
case constant.Picture:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Picture]
|
|
|
|
|
case constant.Voice:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Voice]
|
|
|
|
|
case constant.Video:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Video]
|
|
|
|
|
case constant.File:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.File]
|
|
|
|
|
case constant.AtText:
|
|
|
|
|
a := AtContent{}
|
|
|
|
|
_ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a)
|
|
|
|
|
if utils.IsContain(v.RecvID, a.AtUserList) {
|
|
|
|
|
content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common]
|
|
|
|
|
} else {
|
|
|
|
|
content = constant.ContentType2PushContent[constant.GroupMsg]
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
content = constant.ContentType2PushContent[constant.Common]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pushResult, err := push.JGAccountListPush(UIDList, content, jsonCustomContent, constant.PlatformIDToName(t))
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error(), constant.PlatformIDToName(t))
|
|
|
|
|