From 92f9e10a270407b6fd9afba03e6392e76dbdbb57 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Sat, 14 Nov 2020 16:09:45 +0800 Subject: [PATCH] add send friend poke --- client/builders.go | 18 ++++++++++++++++++ client/client.go | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/client/builders.go b/client/builders.go index d1a564cf..090c10c4 100644 --- a/client/builders.go +++ b/client/builders.go @@ -1019,6 +1019,24 @@ func (c *QQClient) buildGroupPokePacket(groupCode, target int64) (uint16, []byte return seq, packet } +// OidbSvc.0xed3 +func (c *QQClient) buildFriendPokePacket(target int64) (uint16, []byte) { + seq := c.nextSeq() + body := &oidb.DED3ReqBody{ + ToUin: target, + AioUin: target, + } + b, _ := proto.Marshal(body) + req := &oidb.OIDBSSOPkg{ + Command: 3795, + ServiceType: 1, + Bodybuffer: b, + } + payload, _ := proto.Marshal(req) + packet := packets.BuildUniPacket(c.Uin, seq, "OidbSvc.0xed3", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload) + return seq, packet +} + // OidbSvc.0x55c_1 func (c *QQClient) buildGroupAdminSetPacket(groupCode, member int64, flag bool) (uint16, []byte) { seq := c.nextSeq() diff --git a/client/client.go b/client/client.go index 763fe518..5d4a30eb 100644 --- a/client/client.go +++ b/client/client.go @@ -616,6 +616,10 @@ func (c *QQClient) sendGroupPoke(groupCode, target int64) { _, _ = c.sendAndWait(c.buildGroupPokePacket(groupCode, target)) } +func (c *QQClient) SendFriendPoke(target int64) { + _, _ = c.sendAndWait(c.buildFriendPokePacket(target)) +} + func (c *QQClient) UploadGroupImage(groupCode int64, img []byte) (*message.GroupImageElement, error) { h := md5.Sum(img) seq, pkt := c.buildGroupImageStorePacket(groupCode, h[:], int32(len(img)))