Merge remote-tracking branch 'origin/errcode' into errcode

This commit is contained in:
withchao
2023-05-18 10:32:18 +08:00
5 changed files with 32 additions and 19 deletions
@@ -120,19 +120,27 @@ func (och *OnlineHistoryRedisConsumerHandler) getPushStorageMsgList(totalMsgs []
for _, v := range totalMsgs {
options := utils.Options(v.message.Options)
if !options.IsNotNotification() {
// 原通知
notificationMsg := proto.Clone(v.message).(*sdkws.MsgData)
// clone msg from notificationMsg
if options.IsSendMsg() {
msg := proto.Clone(v.message).(*sdkws.MsgData)
// 消息
if v.message.Options != nil {
v.message.Options = utils.WithOptions(utils.Options(v.message.Options), utils.WithNotNotification(true), utils.WithSendMsg(false))
msg.Options = utils.NewMsgOptions()
}
storageMsgList = append(storageMsgList, v.message)
if options.IsOfflinePush() {
v.message.Options = utils.WithOptions(utils.Options(v.message.Options), utils.WithOfflinePush(false))
msg.Options = utils.WithOptions(utils.Options(msg.Options), utils.WithOfflinePush(true))
}
if options.IsUnreadCount() {
v.message.Options = utils.WithOptions(utils.Options(v.message.Options), utils.WithUnreadCount(false))
msg.Options = utils.WithOptions(utils.Options(msg.Options), utils.WithUnreadCount(true))
}
storageMsgList = append(storageMsgList, msg)
}
if isStorage(notificationMsg) {
storageNotificatoinList = append(storageNotificatoinList, notificationMsg)
if isStorage(v.message) {
storageNotificatoinList = append(storageNotificatoinList, v.message)
} else {
notStorageNotificationList = append(notStorageNotificationList, notificationMsg)
notStorageNotificationList = append(notStorageNotificationList, v.message)
}
} else {
if isStorage(v.message) {
+1 -2
View File
@@ -65,8 +65,7 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *msg.SendMsgReq)
var isSend bool = true
conversationID := utils.GetConversationIDByMsg(req.MsgData)
if utils.MsgIsNotification(req.MsgData) {
if !utils.IsNotification(conversationID) {
isSend, err = m.modifyMessageByUserMessageReceiveOpt(ctx, req.MsgData.RecvID, conversationID, constant.SingleChatType, req)
if err != nil {
return nil, err