mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-07 20:45:53 +08:00
Merge
sync
This commit is contained in:
commit
d010640bdc
@ -472,6 +472,7 @@ func (pkt *TroopMemberListRequest) ToBytes() []byte {
|
|||||||
func (pkt *TroopMemberInfo) ReadFrom(r *JceReader) {
|
func (pkt *TroopMemberInfo) ReadFrom(r *JceReader) {
|
||||||
pkt.MemberUin = r.ReadInt64(0)
|
pkt.MemberUin = r.ReadInt64(0)
|
||||||
pkt.FaceId = r.ReadInt16(1)
|
pkt.FaceId = r.ReadInt16(1)
|
||||||
|
pkt.Gender = r.ReadByte(3)
|
||||||
pkt.Nick = r.ReadString(4)
|
pkt.Nick = r.ReadString(4)
|
||||||
pkt.ShowName = r.ReadString(6)
|
pkt.ShowName = r.ReadString(6)
|
||||||
pkt.Name = r.ReadString(8)
|
pkt.Name = r.ReadString(8)
|
||||||
|
@ -753,8 +753,8 @@ func (c *QQClient) buildGroupPttStorePacket(groupCode int64, md5 []byte, size, c
|
|||||||
func (c *QQClient) buildSystemMsgNewGroupPacket() (uint16, []byte) {
|
func (c *QQClient) buildSystemMsgNewGroupPacket() (uint16, []byte) {
|
||||||
seq := c.nextSeq()
|
seq := c.nextSeq()
|
||||||
req := &structmsg.ReqSystemMsgNew{
|
req := &structmsg.ReqSystemMsgNew{
|
||||||
MsgNum: 10,
|
MsgNum: 100,
|
||||||
Version: 100,
|
Version: 1000,
|
||||||
Checktype: 3,
|
Checktype: 3,
|
||||||
Flag: &structmsg.FlagInfo{
|
Flag: &structmsg.FlagInfo{
|
||||||
GrpMsgKickAdmin: 1,
|
GrpMsgKickAdmin: 1,
|
||||||
|
@ -564,7 +564,7 @@ func (c *QQClient) sendGroupLongOrForwardMessage(groupCode int64, isLong bool, m
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
for i, ip := range rsp.Uint32UpIp {
|
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 err == nil {
|
||||||
if !isLong {
|
if !isLong {
|
||||||
var pv string
|
var pv string
|
||||||
@ -613,7 +613,7 @@ func (c *QQClient) UploadGroupImage(groupCode int64, img []byte) (*message.Group
|
|||||||
goto ok
|
goto ok
|
||||||
}
|
}
|
||||||
for i, ip := range rsp.UploadIp {
|
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 {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -498,6 +498,7 @@ func decodeGroupMemberListResponse(_ *QQClient, _ uint16, payload []byte) (inter
|
|||||||
l = append(l, &GroupMemberInfo{
|
l = append(l, &GroupMemberInfo{
|
||||||
Uin: m.MemberUin,
|
Uin: m.MemberUin,
|
||||||
Nickname: m.Nick,
|
Nickname: m.Nick,
|
||||||
|
Gender: m.Gender,
|
||||||
CardName: m.Name,
|
CardName: m.Name,
|
||||||
Level: uint16(m.MemberLevel),
|
Level: uint16(m.MemberLevel),
|
||||||
JoinTime: m.JoinTime,
|
JoinTime: m.JoinTime,
|
||||||
@ -531,6 +532,7 @@ func decodeGroupMemberInfoResponse(c *QQClient, _ uint16, payload []byte) (inter
|
|||||||
return &GroupMemberInfo{
|
return &GroupMemberInfo{
|
||||||
Group: group,
|
Group: group,
|
||||||
Uin: rsp.MemInfo.Uin,
|
Uin: rsp.MemInfo.Uin,
|
||||||
|
Gender: byte(rsp.MemInfo.Sex),
|
||||||
Nickname: string(rsp.MemInfo.Nick),
|
Nickname: string(rsp.MemInfo.Nick),
|
||||||
CardName: string(rsp.MemInfo.Card),
|
CardName: string(rsp.MemInfo.Card),
|
||||||
Level: uint16(rsp.MemInfo.Level),
|
Level: uint16(rsp.MemInfo.Level),
|
||||||
@ -566,7 +568,7 @@ func decodeGroupImageStoreResponse(_ *QQClient, _ uint16, payload []byte) (inter
|
|||||||
}
|
}
|
||||||
if rsp.BoolFileExit {
|
if rsp.BoolFileExit {
|
||||||
if rsp.MsgImgInfo != nil {
|
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
|
return imageUploadResponse{IsExists: true, FileId: rsp.Fid}, nil
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,7 @@ type (
|
|||||||
GroupMemberInfo struct {
|
GroupMemberInfo struct {
|
||||||
Group *GroupInfo
|
Group *GroupInfo
|
||||||
Uin int64
|
Uin int64
|
||||||
|
Gender byte
|
||||||
Nickname string
|
Nickname string
|
||||||
CardName string
|
CardName string
|
||||||
Level uint16
|
Level uint16
|
||||||
@ -251,7 +252,6 @@ const (
|
|||||||
AndroidPhone ClientProtocol = 537062845
|
AndroidPhone ClientProtocol = 537062845
|
||||||
AndroidPad ClientProtocol = 537062409
|
AndroidPad ClientProtocol = 537062409
|
||||||
AndroidWatch ClientProtocol = 537061176
|
AndroidWatch ClientProtocol = 537061176
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (g *GroupInfo) UpdateName(newName string) {
|
func (g *GroupInfo) UpdateName(newName string) {
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
"strconv"
|
"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{
|
addr := net.TCPAddr{
|
||||||
IP: make([]byte, 4),
|
IP: make([]byte, 4),
|
||||||
Port: port,
|
Port: port,
|
||||||
@ -27,8 +27,8 @@ func (c *QQClient) highwayUploadImage(ip uint32, port int, updKey, img []byte, c
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
h := md5.Sum(img)
|
h := md5.Sum(data)
|
||||||
pkt := c.buildImageUploadPacket(img, updKey, cmdId, h)
|
pkt := c.buildImageUploadPacket(data, updKey, cmdId, h)
|
||||||
r := binary.NewNetworkReader(conn)
|
r := binary.NewNetworkReader(conn)
|
||||||
for _, p := range pkt {
|
for _, p := range pkt {
|
||||||
_, err = conn.Write(p)
|
_, err = conn.Write(p)
|
||||||
|
@ -306,15 +306,15 @@ func ToProtoElems(elems []IMessageElement, generalFlags bool) (r []*msg.Elem) {
|
|||||||
CustomFace: &msg.CustomFace{
|
CustomFace: &msg.CustomFace{
|
||||||
FilePath: e.Filename,
|
FilePath: e.Filename,
|
||||||
Md5: e.Md5,
|
Md5: e.Md5,
|
||||||
//Size: e.Size,
|
Size: e.Size,
|
||||||
Flag: make([]byte, 4),
|
Flag: make([]byte, 4),
|
||||||
OldData: imgOld,
|
OldData: imgOld,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
case *GroupImageElement:
|
case *GroupImageElement:
|
||||||
r = append(r, &msg.Elem{
|
r = append(r, &msg.Elem{
|
||||||
CustomFace: &msg.CustomFace{
|
CustomFace: &msg.CustomFace{
|
||||||
//FileType: 66,
|
FileType: 66,
|
||||||
Useful: 1,
|
Useful: 1,
|
||||||
Origin: 1,
|
Origin: 1,
|
||||||
FileId: int32(e.FileId),
|
FileId: int32(e.FileId),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user