mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
rpc protocol update
This commit is contained in:
parent
c6ade8d9bc
commit
822f689c48
@ -214,7 +214,7 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req, sendTime int64) {
|
|||||||
SenderNickName: data.SenderNickName,
|
SenderNickName: data.SenderNickName,
|
||||||
SenderFaceURL: data.SenderFaceURL,
|
SenderFaceURL: data.SenderFaceURL,
|
||||||
Content: data.Content,
|
Content: data.Content,
|
||||||
Options: utils.MapIntToJsonString(data.Options),
|
Options: data.Options,
|
||||||
ClientMsgID: data.ClientMsgID,
|
ClientMsgID: data.ClientMsgID,
|
||||||
SendTime: sendTime,
|
SendTime: sendTime,
|
||||||
}
|
}
|
||||||
|
@ -54,11 +54,10 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string)
|
|||||||
pbSaveData.OperationID = pbData.OperationID
|
pbSaveData.OperationID = pbData.OperationID
|
||||||
pbSaveData.RecvID = pbData.RecvID
|
pbSaveData.RecvID = pbData.RecvID
|
||||||
pbSaveData.PlatformID = pbData.PlatformID
|
pbSaveData.PlatformID = pbData.PlatformID
|
||||||
Options := utils.JsonStringToMap(pbData.Options)
|
|
||||||
//Control whether to store offline messages (mongo)
|
//Control whether to store offline messages (mongo)
|
||||||
isHistory := utils.GetSwitchFromOptions(Options, "history")
|
isHistory := utils.GetSwitchFromOptions(pbData.Options, "history")
|
||||||
//Control whether to store history messages (mysql)
|
//Control whether to store history messages (mysql)
|
||||||
isPersist := utils.GetSwitchFromOptions(Options, "persistent")
|
isPersist := utils.GetSwitchFromOptions(pbData.Options, "persistent")
|
||||||
switch pbData.SessionType {
|
switch pbData.SessionType {
|
||||||
case constant.SingleChatType:
|
case constant.SingleChatType:
|
||||||
log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = SingleChatType", isHistory, isPersist)
|
log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = SingleChatType", isHistory, isPersist)
|
||||||
|
@ -40,9 +40,8 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey strin
|
|||||||
log.ErrorByKv("msg_transfer Unmarshal chat err", "", "chat", string(msg), "err", err.Error())
|
log.ErrorByKv("msg_transfer Unmarshal chat err", "", "chat", string(msg), "err", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Options := utils.JsonStringToMap(pbData.Options)
|
|
||||||
//Control whether to store history messages (mysql)
|
//Control whether to store history messages (mysql)
|
||||||
isPersist := utils.GetSwitchFromOptions(Options, "persistent")
|
isPersist := utils.GetSwitchFromOptions(pbData.Options, "persistent")
|
||||||
//Only process receiver data
|
//Only process receiver data
|
||||||
if isPersist {
|
if isPersist {
|
||||||
if msgKey == pbData.RecvID && pbData.SessionType == constant.SingleChatType {
|
if msgKey == pbData.RecvID && pbData.SessionType == constant.SingleChatType {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user