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

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

@ -453,13 +453,14 @@ 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 {
if quoteMsg.QuoteMessage.Seq > 0 {
ms, err := db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, db.msg.GetDocID(conversationID, quoteMsg.QuoteMessage.Seq), []int64{quoteMsg.QuoteMessage.Seq}) ms, err := db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, db.msg.GetDocID(conversationID, quoteMsg.QuoteMessage.Seq), []int64{quoteMsg.QuoteMessage.Seq})
if err != nil { if err != nil {
log.ZError(ctx, "GetMsgBySeqIndexIn1Doc", err, "conversationID", conversationID, "seq", quoteMsg.QuoteMessage.Seq) log.ZError(ctx, "GetMsgBySeqIndexIn1Doc", err, "conversationID", conversationID, "seq", quoteMsg.QuoteMessage.Seq)
@ -468,6 +469,7 @@ func (db *commonMsgDatabase) handlerDBMsg(ctx context.Context, cache map[int64][
msgs = ms msgs = ms
cache[quoteMsg.QuoteMessage.Seq] = 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