فهرست منبع

fix:未读消息数走redis修改

duxin 1 سال پیش
والد
کامیت
75bca6caa9
1فایلهای تغییر یافته به همراه14 افزوده شده و 11 حذف شده
  1. 14 11
      rpc/internal/common/sendMsg.go

+ 14 - 11
rpc/internal/common/sendMsg.go

@@ -384,17 +384,20 @@ func MsgCountMinusOne(userId, appId string, msgType int64) bool {
 
 // MsgCountZero 把该消息类型未读数量置0
 func MsgCountZero(userId, appId string, msgType int64) bool {
-	keyString := fmt.Sprintf(MsgCountKey, userId, msgType)
-	fool := redis.Put(redisModule, keyString, 0, -1)
-	FindUserMsg(message.FindUserMsgReq{
-		UserId:   userId,
-		Appid:    appId,
-		OffSet:   1,
-		PageSize: 5,
-		MsgType:  -1,
-		Read:     0,
-	}, true)
-	return fool
+	if msgType > 0 && msgType < 999 { //全部私信不统计
+		keyString := fmt.Sprintf(MsgCountKey, userId, msgType)
+		fool := redis.Put(redisModule, keyString, 0, -1)
+		FindUserMsg(message.FindUserMsgReq{
+			UserId:   userId,
+			Appid:    appId,
+			OffSet:   1,
+			PageSize: 5,
+			MsgType:  -1,
+			Read:     0,
+		}, true)
+		return fool
+	}
+	return true
 }
 
 func MultSave(this message.MultipleSaveMsgReq) (int64, string) {