diff --git a/client/builders.go b/client/builders.go index b0a476cc..06cc5e43 100644 --- a/client/builders.go +++ b/client/builders.go @@ -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, diff --git a/client/client.go b/client/client.go index fb806935..8ee00416 100644 --- a/client/client.go +++ b/client/client.go @@ -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 } diff --git a/client/decoders.go b/client/decoders.go index b1a0103a..5e9f759e 100644 --- a/client/decoders.go +++ b/client/decoders.go @@ -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 }