mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
fix session miss.
This commit is contained in:
parent
681dd6d407
commit
0a256bc3e0
@ -46,6 +46,7 @@ type (
|
|||||||
|
|
||||||
sessionSyncEvent struct {
|
sessionSyncEvent struct {
|
||||||
IsEnd bool
|
IsEnd bool
|
||||||
|
GroupNum int32
|
||||||
GroupSessions []*GroupSessionInfo
|
GroupSessions []*GroupSessionInfo
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -81,7 +82,7 @@ func (c *QQClient) SyncSessions() (*SessionSyncResponse, error) {
|
|||||||
}
|
}
|
||||||
ret := &SessionSyncResponse{}
|
ret := &SessionSyncResponse{}
|
||||||
notifyChan := make(chan bool)
|
notifyChan := make(chan bool)
|
||||||
ended := false
|
var groupNum int32 = -1
|
||||||
p := 0
|
p := 0
|
||||||
stop := c.waitPacket("RegPrxySvc.PbSyncMsg", func(i interface{}, err error) {
|
stop := c.waitPacket("RegPrxySvc.PbSyncMsg", func(i interface{}, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -92,10 +93,10 @@ func (c *QQClient) SyncSessions() (*SessionSyncResponse, error) {
|
|||||||
if len(e.GroupSessions) > 0 {
|
if len(e.GroupSessions) > 0 {
|
||||||
ret.GroupSessions = append(ret.GroupSessions, e.GroupSessions...)
|
ret.GroupSessions = append(ret.GroupSessions, e.GroupSessions...)
|
||||||
}
|
}
|
||||||
if e.IsEnd {
|
if e.GroupNum != -1 {
|
||||||
ended = true
|
groupNum = e.GroupNum
|
||||||
}
|
}
|
||||||
if p > 1 {
|
if groupNum != -1 && len(ret.GroupSessions) >= int(groupNum) {
|
||||||
notifyChan <- true
|
notifyChan <- true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -349,7 +350,11 @@ func decodeMsgSyncResponse(c *QQClient, _ uint16, payload []byte) (interface{},
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
ret := &sessionSyncEvent{
|
ret := &sessionSyncEvent{
|
||||||
IsEnd: (rsp.GetFlag() & 2) == 2,
|
IsEnd: (rsp.GetFlag() & 2) == 2,
|
||||||
|
GroupNum: -1,
|
||||||
|
}
|
||||||
|
if rsp.Info != nil {
|
||||||
|
ret.GroupNum = int32(rsp.Info.GetGroupNum())
|
||||||
}
|
}
|
||||||
if len(rsp.GroupMsg) > 0 {
|
if len(rsp.GroupMsg) > 0 {
|
||||||
for _, gm := range rsp.GroupMsg {
|
for _, gm := range rsp.GroupMsg {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user