|
|
|
@ -14,11 +14,9 @@ import (
|
|
|
|
|
pbChat "Open_IM/src/proto/chat"
|
|
|
|
|
pbGroup "Open_IM/src/proto/group"
|
|
|
|
|
pbRelay "Open_IM/src/proto/relay"
|
|
|
|
|
push "Open_IM/src/push/jpush"
|
|
|
|
|
rpcChat "Open_IM/src/rpc/chat/chat"
|
|
|
|
|
"Open_IM/src/utils"
|
|
|
|
|
"context"
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"strings"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -58,22 +56,22 @@ func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) {
|
|
|
|
|
for _, t := range pushTerminal {
|
|
|
|
|
if v.RecvPlatFormID == t {
|
|
|
|
|
//Use offline push messaging
|
|
|
|
|
var UIDList []string
|
|
|
|
|
UIDList = append(UIDList, sendPbData.RecvID)
|
|
|
|
|
customContent := EChatContent{
|
|
|
|
|
SessionType: int(sendPbData.SessionType),
|
|
|
|
|
From: sendPbData.SendID,
|
|
|
|
|
To: sendPbData.RecvID,
|
|
|
|
|
Seq: sendPbData.RecvSeq,
|
|
|
|
|
}
|
|
|
|
|
bCustomContent, _ := json.Marshal(customContent)
|
|
|
|
|
jsonCustomContent := string(bCustomContent)
|
|
|
|
|
pushResult, err := push.JGAccountListPush(UIDList, jsonCustomContent, utils.PlatformIDToName(t))
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), t)
|
|
|
|
|
} else {
|
|
|
|
|
log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, t)
|
|
|
|
|
}
|
|
|
|
|
//var UIDList []string
|
|
|
|
|
//UIDList = append(UIDList, sendPbData.RecvID)
|
|
|
|
|
//customContent := EChatContent{
|
|
|
|
|
// SessionType: int(sendPbData.SessionType),
|
|
|
|
|
// From: sendPbData.SendID,
|
|
|
|
|
// To: sendPbData.RecvID,
|
|
|
|
|
// Seq: sendPbData.RecvSeq,
|
|
|
|
|
//}
|
|
|
|
|
//bCustomContent, _ := json.Marshal(customContent)
|
|
|
|
|
//jsonCustomContent := string(bCustomContent)
|
|
|
|
|
//pushResult, err := push.JGAccountListPush(UIDList, jsonCustomContent, utils.PlatformIDToName(t))
|
|
|
|
|
//if err != nil {
|
|
|
|
|
// log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), t)
|
|
|
|
|
//} else {
|
|
|
|
|
// log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, t)
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|