1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-07 12:43:32 +08:00
sync
This commit is contained in:
wdvxdr1123 2020-10-03 10:11:16 +08:00 committed by GitHub
commit d010640bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 13 deletions

View File

@ -472,6 +472,7 @@ func (pkt *TroopMemberListRequest) ToBytes() []byte {
func (pkt *TroopMemberInfo) ReadFrom(r *JceReader) {
pkt.MemberUin = r.ReadInt64(0)
pkt.FaceId = r.ReadInt16(1)
pkt.Gender = r.ReadByte(3)
pkt.Nick = r.ReadString(4)
pkt.ShowName = r.ReadString(6)
pkt.Name = r.ReadString(8)

View File

@ -753,8 +753,8 @@ func (c *QQClient) buildGroupPttStorePacket(groupCode int64, md5 []byte, size, c
func (c *QQClient) buildSystemMsgNewGroupPacket() (uint16, []byte) {
seq := c.nextSeq()
req := &structmsg.ReqSystemMsgNew{
MsgNum: 10,
Version: 100,
MsgNum: 100,
Version: 1000,
Checktype: 3,
Flag: &structmsg.FlagInfo{
GrpMsgKickAdmin: 1,

View File

@ -564,7 +564,7 @@ func (c *QQClient) sendGroupLongOrForwardMessage(groupCode int64, isLong bool, m
},
})
for i, ip := range rsp.Uint32UpIp {
err := c.highwayUploadImage(uint32(ip), int(rsp.Uint32UpPort[i]), rsp.MsgSig, body, 27)
err := c.highwayUpload(uint32(ip), int(rsp.Uint32UpPort[i]), rsp.MsgSig, body, 27)
if err == nil {
if !isLong {
var pv string
@ -613,7 +613,7 @@ func (c *QQClient) UploadGroupImage(groupCode int64, img []byte) (*message.Group
goto ok
}
for i, ip := range rsp.UploadIp {
err := c.highwayUploadImage(uint32(ip), int(rsp.UploadPort[i]), rsp.UploadKey, img, 2)
err := c.highwayUpload(uint32(ip), int(rsp.UploadPort[i]), rsp.UploadKey, img, 2)
if err != nil {
continue
}

View File

@ -498,6 +498,7 @@ func decodeGroupMemberListResponse(_ *QQClient, _ uint16, payload []byte) (inter
l = append(l, &GroupMemberInfo{
Uin: m.MemberUin,
Nickname: m.Nick,
Gender: m.Gender,
CardName: m.Name,
Level: uint16(m.MemberLevel),
JoinTime: m.JoinTime,
@ -531,6 +532,7 @@ func decodeGroupMemberInfoResponse(c *QQClient, _ uint16, payload []byte) (inter
return &GroupMemberInfo{
Group: group,
Uin: rsp.MemInfo.Uin,
Gender: byte(rsp.MemInfo.Sex),
Nickname: string(rsp.MemInfo.Nick),
CardName: string(rsp.MemInfo.Card),
Level: uint16(rsp.MemInfo.Level),
@ -566,7 +568,7 @@ func decodeGroupImageStoreResponse(_ *QQClient, _ uint16, payload []byte) (inter
}
if rsp.BoolFileExit {
if rsp.MsgImgInfo != nil {
return imageUploadResponse{IsExists: true, FileId: rsp.FileId, Width: rsp.MsgImgInfo.FileWidth, Height: rsp.MsgImgInfo.FileHeight}, nil
return imageUploadResponse{IsExists: true, FileId: rsp.Fid, Width: rsp.MsgImgInfo.FileWidth, Height: rsp.MsgImgInfo.FileHeight}, nil
}
return imageUploadResponse{IsExists: true, FileId: rsp.Fid}, nil
}

View File

@ -77,6 +77,7 @@ type (
GroupMemberInfo struct {
Group *GroupInfo
Uin int64
Gender byte
Nickname string
CardName string
Level uint16
@ -251,7 +252,6 @@ const (
AndroidPhone ClientProtocol = 537062845
AndroidPad ClientProtocol = 537062409
AndroidWatch ClientProtocol = 537061176
)
func (g *GroupInfo) UpdateName(newName string) {

View File

@ -16,7 +16,7 @@ import (
"strconv"
)
func (c *QQClient) highwayUploadImage(ip uint32, port int, updKey, img []byte, cmdId int32) error {
func (c *QQClient) highwayUpload(ip uint32, port int, updKey, data []byte, cmdId int32) error {
addr := net.TCPAddr{
IP: make([]byte, 4),
Port: port,
@ -27,8 +27,8 @@ func (c *QQClient) highwayUploadImage(ip uint32, port int, updKey, img []byte, c
return err
}
defer conn.Close()
h := md5.Sum(img)
pkt := c.buildImageUploadPacket(img, updKey, cmdId, h)
h := md5.Sum(data)
pkt := c.buildImageUploadPacket(data, updKey, cmdId, h)
r := binary.NewNetworkReader(conn)
for _, p := range pkt {
_, err = conn.Write(p)

View File

@ -306,15 +306,15 @@ func ToProtoElems(elems []IMessageElement, generalFlags bool) (r []*msg.Elem) {
CustomFace: &msg.CustomFace{
FilePath: e.Filename,
Md5: e.Md5,
//Size: e.Size,
Flag: make([]byte, 4),
OldData: imgOld,
Size: e.Size,
Flag: make([]byte, 4),
OldData: imgOld,
},
})
case *GroupImageElement:
r = append(r, &msg.Elem{
CustomFace: &msg.CustomFace{
//FileType: 66,
FileType: 66,
Useful: 1,
Origin: 1,
FileId: int32(e.FileId),