diff --git a/binary/jce/structs.go b/binary/jce/structs.go index 30e648e7..273e3d48 100644 --- a/binary/jce/structs.go +++ b/binary/jce/structs.go @@ -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) diff --git a/client/builders.go b/client/builders.go index fd10ca02..de540f1a 100644 --- a/client/builders.go +++ b/client/builders.go @@ -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, diff --git a/client/client.go b/client/client.go index 6065f786..13f7efcb 100644 --- a/client/client.go +++ b/client/client.go @@ -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 } diff --git a/client/decoders.go b/client/decoders.go index cece7b27..c01e585a 100644 --- a/client/decoders.go +++ b/client/decoders.go @@ -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 } diff --git a/client/entities.go b/client/entities.go index 2be8d755..dac40505 100644 --- a/client/entities.go +++ b/client/entities.go @@ -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) { diff --git a/client/highway.go b/client/highway.go index 9e794aa0..2183c342 100644 --- a/client/highway.go +++ b/client/highway.go @@ -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) diff --git a/message/message.go b/message/message.go index f1856b8d..a6827c6a 100644 --- a/message/message.go +++ b/message/message.go @@ -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),