mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
filter c2c msg by time.
This commit is contained in:
parent
f6579d20cd
commit
8f0cd9494d
@ -119,6 +119,11 @@ func (c *QQClient) commMsgProcessor(pMsg *msg.Message, info *incomingPacketInfo)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.msgSvcCache.Add(strKey, "", time.Hour)
|
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") {
|
if info.Params.bool("init") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ type QQClient struct {
|
|||||||
lastMessageSeq int32
|
lastMessageSeq int32
|
||||||
// lastMessageSeqTmp sync.Map
|
// lastMessageSeqTmp sync.Map
|
||||||
msgSvcCache *utils.Cache
|
msgSvcCache *utils.Cache
|
||||||
|
lastC2CMsgTime int64
|
||||||
transCache *utils.Cache
|
transCache *utils.Cache
|
||||||
lastLostMsg string
|
lastLostMsg string
|
||||||
groupSysMsgCache *GroupSystemMessages
|
groupSysMsgCache *GroupSystemMessages
|
||||||
|
Loading…
x
Reference in New Issue
Block a user