1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

refresh skey before getCSRFToken

This commit is contained in:
wdvxdr 2021-07-22 23:38:22 +08:00
parent ddf3476b30
commit 4e350e6b2a
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
2 changed files with 5 additions and 6 deletions

View File

@ -545,7 +545,7 @@ func (c *QQClient) GetFriendList() (*FriendListResponse, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
list := rsp.(FriendListResponse) list := rsp.(*FriendListResponse)
r.TotalCount = list.TotalCount r.TotalCount = list.TotalCount
r.List = append(r.List, list.List...) r.List = append(r.List, list.List...)
curFriendCount += len(list.List) curFriendCount += len(list.List)
@ -736,9 +736,8 @@ func (c *QQClient) FindGroupByUin(uin int64) *GroupInfo {
func (c *QQClient) FindGroup(code int64) *GroupInfo { func (c *QQClient) FindGroup(code int64) *GroupInfo {
for _, g := range c.GroupList { for _, g := range c.GroupList {
f := g if g.Code == code {
if f.Code == code { return g
return f
} }
} }
return nil return nil
@ -795,7 +794,7 @@ func (c *QQClient) getCookiesWithDomain(domain string) string {
func (c *QQClient) getCSRFToken() int { func (c *QQClient) getCSRFToken() int {
accu := 5381 accu := 5381
for _, b := range c.sigInfo.sKey { for _, b := range []byte(c.getSKey()) {
accu = accu + (accu << 5) + int(b) accu = accu + (accu << 5) + int(b)
} }
return 2147483647 & accu return 2147483647 & accu

View File

@ -475,7 +475,7 @@ func decodeFriendGroupListResponse(_ *QQClient, _ *incomingPacketInfo, payload [
FaceId: f.FaceId, FaceId: f.FaceId,
}) })
} }
rsp := FriendListResponse{ rsp := &FriendListResponse{
TotalCount: int32(totalFriendCount), TotalCount: int32(totalFriendCount),
List: l, List: l,
} }