fix: the original message referenced by the pull message processing is withdrawn

pull/1388/head
withchao 2 years ago
parent 6546031db0
commit a28adc5ab6

@ -453,20 +453,22 @@ func (db *commonMsgDatabase) handlerDBMsg(ctx context.Context, cache map[int64][
log.ZError(ctx, "json.Unmarshal", err) log.ZError(ctx, "json.Unmarshal", err)
return return
} }
if quoteMsg.QuoteMessage == nil || quoteMsg.QuoteMessage.ContentType == constant.MsgRevokeNotification { //if quoteMsg.QuoteMessage == nil || quoteMsg.QuoteMessage.ContentType == constant.MsgRevokeNotification {
return // return
} //}
var msgs []*unrelationtb.MsgInfoModel var msgs []*unrelationtb.MsgInfoModel
if v, ok := cache[quoteMsg.QuoteMessage.Seq]; ok { if v, ok := cache[quoteMsg.QuoteMessage.Seq]; ok {
msgs = v msgs = v
} else { } else {
ms, err := db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, db.msg.GetDocID(conversationID, quoteMsg.QuoteMessage.Seq), []int64{quoteMsg.QuoteMessage.Seq}) if quoteMsg.QuoteMessage.Seq > 0 {
if err != nil { ms, err := db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, db.msg.GetDocID(conversationID, quoteMsg.QuoteMessage.Seq), []int64{quoteMsg.QuoteMessage.Seq})
log.ZError(ctx, "GetMsgBySeqIndexIn1Doc", err, "conversationID", conversationID, "seq", quoteMsg.QuoteMessage.Seq) if err != nil {
return log.ZError(ctx, "GetMsgBySeqIndexIn1Doc", err, "conversationID", conversationID, "seq", quoteMsg.QuoteMessage.Seq)
return
}
msgs = ms
cache[quoteMsg.QuoteMessage.Seq] = ms
} }
msgs = ms
cache[quoteMsg.QuoteMessage.Seq] = ms
} }
if len(msgs) != 0 && msgs[0].Msg.ContentType != constant.MsgRevokeNotification { if len(msgs) != 0 && msgs[0].Msg.ContentType != constant.MsgRevokeNotification {
return return

Loading…
Cancel
Save