From 8f4a2f6c3a72728ed88c11cdb705d06e0dfe9bf6 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Mon, 31 May 2021 17:58:34 +0800 Subject: [PATCH] fix: private message uid --- client/global.go | 7 ++++--- client/recall.go | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/global.go b/client/global.go index b2eef890..11144b9e 100644 --- a/client/global.go +++ b/client/global.go @@ -13,6 +13,9 @@ import ( "strings" "time" + "github.com/pkg/errors" + "google.golang.org/protobuf/proto" + "github.com/Mrs4s/MiraiGo/binary" "github.com/Mrs4s/MiraiGo/binary/jce" devinfo "github.com/Mrs4s/MiraiGo/client/pb" @@ -20,8 +23,6 @@ import ( "github.com/Mrs4s/MiraiGo/client/pb/oidb" "github.com/Mrs4s/MiraiGo/message" "github.com/Mrs4s/MiraiGo/utils" - "github.com/pkg/errors" - "google.golang.org/protobuf/proto" ) type ( @@ -506,12 +507,12 @@ func (c *QQClient) parsePrivateMessage(msg *msg.Message) *message.PrivateMessage sender = &message.Sender{ Uin: msg.Head.GetFromUin(), Nickname: msg.Head.GetFromNick(), - IsFriend: false, } } else { sender = &message.Sender{ Uin: friend.Uin, Nickname: friend.Nickname, + IsFriend: true, } } ret := &message.PrivateMessage{ diff --git a/client/recall.go b/client/recall.go index a555ea83..2d5719f7 100644 --- a/client/recall.go +++ b/client/recall.go @@ -1,11 +1,12 @@ package client import ( + "github.com/pkg/errors" + "google.golang.org/protobuf/proto" + "github.com/Mrs4s/MiraiGo/client/pb/msg" "github.com/Mrs4s/MiraiGo/message" "github.com/Mrs4s/MiraiGo/protocol/packets" - "github.com/pkg/errors" - "google.golang.org/protobuf/proto" ) // 撤回相关处理逻辑 @@ -75,7 +76,7 @@ func (c *QQClient) buildPrivateRecallPacket(uin, ts int64, msgSeq, random int32) FromUin: &c.Uin, ToUin: &uin, MsgTime: &ts, - MsgUid: proto.Int64(int64(random)), + MsgUid: proto.Int64(0x01000000000000000 | (int64(random) & 0xFFFFFFFF)), MsgSeq: &msgSeq, MsgRandom: &random, },