diff --git a/client/c2c_processor.go b/client/c2c_processor.go index 4c924860..5e67fc74 100644 --- a/client/c2c_processor.go +++ b/client/c2c_processor.go @@ -119,6 +119,11 @@ func (c *QQClient) commMsgProcessor(pMsg *msg.Message, info *incomingPacketInfo) return } c.msgSvcCache.Add(strKey, "", time.Hour) + if c.lastC2CMsgTime > int64(pMsg.Head.GetMsgTime()) && (c.lastC2CMsgTime-int64(pMsg.Head.GetMsgTime())) > 60*10 { + c.Debug("c2c msg filtered by time. lastMsgTime: %v msgTime: %v", c.lastC2CMsgTime, pMsg.Head.GetMsgTime()) + return + } + c.lastC2CMsgTime = int64(pMsg.Head.GetMsgTime()) if info.Params.bool("init") { return } diff --git a/client/client.go b/client/client.go index 3f1b2b46..e7a3fef1 100644 --- a/client/client.go +++ b/client/client.go @@ -85,6 +85,7 @@ type QQClient struct { lastMessageSeq int32 // lastMessageSeqTmp sync.Map msgSvcCache *utils.Cache + lastC2CMsgTime int64 transCache *utils.Cache lastLostMsg string groupSysMsgCache *GroupSystemMessages