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

update GroupInfo.

This commit is contained in:
Mrs4s 2021-01-24 14:56:45 +08:00
parent a401ed3ef1
commit 9549a32d95
2 changed files with 7 additions and 5 deletions

View File

@ -24,10 +24,12 @@ type (
MemberCount uint16
MaxMemberCount uint16
Members []*GroupMemberInfo
// 最后一条信息的SEQ,只有通过 GetGroupInfo 函数获取的 GroupInfo 才会有
LastMsgSeq int64
client *QQClient
lastMsgSeq int64
lock sync.RWMutex
client *QQClient
lock sync.RWMutex
}
GroupMemberInfo struct {
@ -183,7 +185,7 @@ func decodeGroupInfoResponse(c *QQClient, _ uint16, payload []byte) (interface{}
MemberCount: uint16(*info.GroupInfo.GroupMemberNum),
MaxMemberCount: uint16(*info.GroupInfo.GroupMemberMaxNum),
Members: []*GroupMemberInfo{},
lastMsgSeq: int64(info.GroupInfo.GetGroupCurMsgSeq()),
LastMsgSeq: int64(info.GroupInfo.GetGroupCurMsgSeq()),
client: c,
}, nil
}

View File

@ -142,7 +142,7 @@ func (c *QQClient) sendGroupMessage(groupCode int64, forward bool, m *message.Se
return ret
case <-time.After(time.Second * 5):
if g, err := c.GetGroupInfo(groupCode); err == nil {
if history, err := c.GetGroupMessages(groupCode, g.lastMsgSeq-10, g.lastMsgSeq+1); err == nil {
if history, err := c.GetGroupMessages(groupCode, g.LastMsgSeq-10, g.LastMsgSeq+1); err == nil {
for _, m := range history {
if m.InternalId == mr {
return m