From 39a33e4c4965a65a9a6df43e972c61530aab32a4 Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Wed, 3 Mar 2021 00:37:21 +0800 Subject: [PATCH] fix history message. --- client/client.go | 1 + client/decoders.go | 3 --- client/sync.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/client.go b/client/client.go index 23f95e24..921cbf84 100644 --- a/client/client.go +++ b/client/client.go @@ -313,6 +313,7 @@ func (c *QQClient) init() { go c.doHeartbeat() } _ = c.RefreshStatus() + _, _ = c.sendAndWait(c.buildGetMessageRequestPacket(msg.SyncFlag_START, time.Now().Unix())) _, _ = c.SyncSessions() c.stat.once.Do(func() { c.OnGroupMessage(func(_ *QQClient, _ *message.GroupMessage) { diff --git a/client/decoders.go b/client/decoders.go index dad96735..602279bf 100644 --- a/client/decoders.go +++ b/client/decoders.go @@ -10,8 +10,6 @@ import ( "sync" "time" - log "github.com/sirupsen/logrus" - "github.com/Mrs4s/MiraiGo/binary" "github.com/Mrs4s/MiraiGo/binary/jce" "github.com/Mrs4s/MiraiGo/client/pb" @@ -658,7 +656,6 @@ func decodeOnlinePushReqPacket(c *QQClient, seq uint16, payload []byte) (interfa if m.DelFriend != nil { frdUin := m.DelFriend.Uins[0] if frd := c.FindFriend(int64(frdUin)); frd != nil { - log.Infof("好友被删除: %v(%v)", frd.Nickname, frd.Uin) if err := c.ReloadFriendList(); err != nil { return nil, errors.Wrap(err, "failed to reload friend list") } diff --git a/client/sync.go b/client/sync.go index 8c888944..52c31dbf 100644 --- a/client/sync.go +++ b/client/sync.go @@ -101,7 +101,7 @@ func (c *QQClient) SyncSessions() (*SessionSyncResponse, error) { select { case <-notifyChan: stop() - case <-time.After(time.Second * 5): + case <-time.After(time.Second * 20): stop() } return ret, nil