mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
try to fix group list limit.
This commit is contained in:
parent
808a63a78e
commit
37409b1f6b
@ -252,12 +252,12 @@ func (c *QQClient) buildFriendGroupListRequestPacket(friendStartIndex, friendLis
|
||||
}
|
||||
|
||||
// friendlist.GetTroopListReqV2
|
||||
func (c *QQClient) buildGroupListRequestPacket() (uint16, []byte) {
|
||||
func (c *QQClient) buildGroupListRequestPacket(vecCookie []byte) (uint16, []byte) {
|
||||
seq := c.nextSeq()
|
||||
req := &jce.TroopListRequest{
|
||||
Uin: c.Uin,
|
||||
GetMSFMsgFlag: 1,
|
||||
Cookies: []byte{},
|
||||
Cookies: vecCookie,
|
||||
GroupInfo: []int64{},
|
||||
GroupFlagExt: 1,
|
||||
Version: 7,
|
||||
|
@ -653,7 +653,7 @@ func (c *QQClient) ReloadGroupList() error {
|
||||
}
|
||||
|
||||
func (c *QQClient) GetGroupList() ([]*GroupInfo, error) {
|
||||
rsp, err := c.sendAndWait(c.buildGroupListRequestPacket())
|
||||
rsp, err := c.sendAndWait(c.buildGroupListRequestPacket(EmptyBytes))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -333,7 +333,9 @@ func decodeGroupListResponse(c *QQClient, _ uint16, payload []byte) (interface{}
|
||||
data := &jce.RequestDataVersion3{}
|
||||
data.ReadFrom(jce.NewJceReader(request.SBuffer))
|
||||
r := jce.NewJceReader(data.Map["GetTroopListRespV2"][1:])
|
||||
vecCookie := []byte{}
|
||||
groups := []jce.TroopNumber{}
|
||||
r.ReadSlice(&vecCookie, 4)
|
||||
r.ReadSlice(&groups, 5)
|
||||
var l []*GroupInfo
|
||||
for _, g := range groups {
|
||||
@ -348,6 +350,13 @@ func decodeGroupListResponse(c *QQClient, _ uint16, payload []byte) (interface{}
|
||||
client: c,
|
||||
})
|
||||
}
|
||||
if len(vecCookie) > 0 {
|
||||
rsp, err := c.sendAndWait(c.buildGroupListRequestPacket(vecCookie))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
l = append(l, rsp.([]*GroupInfo)...)
|
||||
}
|
||||
return l, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user