From 23ff9b7269b141b7383cfc1b5178ca3e996e68fc Mon Sep 17 00:00:00 2001 From: Mrs4s <1844812067@qq.com> Date: Sat, 1 Aug 2020 08:05:26 +0800 Subject: [PATCH] bug fix. --- client/decoders.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/decoders.go b/client/decoders.go index 0cec6134..9c0a3131 100644 --- a/client/decoders.go +++ b/client/decoders.go @@ -13,6 +13,7 @@ import ( "github.com/Mrs4s/MiraiGo/client/pb/structmsg" "github.com/Mrs4s/MiraiGo/utils" "github.com/golang/protobuf/proto" + "math" "sync" "sync/atomic" "time" @@ -229,7 +230,7 @@ func decodeMessageSvcPacket(c *QQClient, _ uint16, payload []byte) (interface{}, continue } if c.lastMessageSeq >= message.Head.MsgSeq { - if c.lastMessageSeq-message.Head.MsgSeq < 1000 { + if math.Abs(float64(c.lastMessageSeq-message.Head.MsgSeq)) < 1000 { continue } }