mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-30 02:30:01 +08:00
push fix
This commit is contained in:
parent
082de2b6b7
commit
a87c16de0d
@ -31,7 +31,6 @@ type EChatContent struct {
|
|||||||
|
|
||||||
func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) {
|
func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) {
|
||||||
var wsResult []*pbRelay.SingleMsgToUser
|
var wsResult []*pbRelay.SingleMsgToUser
|
||||||
isShouldOfflinePush := true
|
|
||||||
MOptions := utils.JsonStringToMap(Options) //Control whether to push message to sender's other terminal
|
MOptions := utils.JsonStringToMap(Options) //Control whether to push message to sender's other terminal
|
||||||
//isSenderSync := utils.GetSwitchFromOptions(MOptions, "senderSync")
|
//isSenderSync := utils.GetSwitchFromOptions(MOptions, "senderSync")
|
||||||
isOfflinePush := utils.GetSwitchFromOptions(MOptions, "offlinePush")
|
isOfflinePush := utils.GetSwitchFromOptions(MOptions, "offlinePush")
|
||||||
@ -51,15 +50,13 @@ func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) {
|
|||||||
}
|
}
|
||||||
log.InfoByKv("push_result", sendPbData.OperationID, "result", wsResult, "sendData", sendPbData)
|
log.InfoByKv("push_result", sendPbData.OperationID, "result", wsResult, "sendData", sendPbData)
|
||||||
if isOfflinePush {
|
if isOfflinePush {
|
||||||
|
|
||||||
for _, t := range pushTerminal {
|
|
||||||
for _, v := range wsResult {
|
for _, v := range wsResult {
|
||||||
if v.RecvPlatFormID == t && v.ResultCode == 0 {
|
if v.ResultCode == 0 {
|
||||||
isShouldOfflinePush = false
|
continue
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
//supported terminal
|
||||||
if isShouldOfflinePush {
|
for _, t := range pushTerminal {
|
||||||
|
if v.RecvPlatFormID == t {
|
||||||
//Use offline push messaging
|
//Use offline push messaging
|
||||||
var UIDList []string
|
var UIDList []string
|
||||||
UIDList = append(UIDList, sendPbData.RecvID)
|
UIDList = append(UIDList, sendPbData.RecvID)
|
||||||
@ -70,31 +67,14 @@ func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) {
|
|||||||
Seq: sendPbData.RecvSeq,
|
Seq: sendPbData.RecvSeq,
|
||||||
}
|
}
|
||||||
bCustomContent, _ := json.Marshal(customContent)
|
bCustomContent, _ := json.Marshal(customContent)
|
||||||
|
|
||||||
jsonCustomContent := string(bCustomContent)
|
jsonCustomContent := string(bCustomContent)
|
||||||
//switch sendPbData.ContentType {
|
|
||||||
//case constant.Text:
|
|
||||||
// IOSAccountListPush(UIDList, sendPbData.SenderNickName, sendPbData.Content, jsonCustomContent)
|
|
||||||
//case constant.Picture:
|
|
||||||
// IOSAccountListPush(UIDList, sendPbData.SenderNickName, constant.ContentType2PushContent[constant.Picture], jsonCustomContent)
|
|
||||||
//case constant.Voice:
|
|
||||||
// IOSAccountListPush(UIDList, sendPbData.SenderNickName, constant.ContentType2PushContent[constant.Voice], jsonCustomContent)
|
|
||||||
//case constant.Video:
|
|
||||||
// IOSAccountListPush(UIDList, sendPbData.SenderNickName, constant.ContentType2PushContent[constant.Video], jsonCustomContent)
|
|
||||||
//case constant.File:
|
|
||||||
// IOSAccountListPush(UIDList, sendPbData.SenderNickName, constant.ContentType2PushContent[constant.File], jsonCustomContent)
|
|
||||||
//default:
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
push.JGAccountListPush(UIDList, jsonCustomContent, utils.PlatformIDToName(t))
|
push.JGAccountListPush(UIDList, jsonCustomContent, utils.PlatformIDToName(t))
|
||||||
|
|
||||||
} else {
|
}
|
||||||
isShouldOfflinePush = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) {
|
func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user