mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
update GroupInfo.
This commit is contained in:
parent
a401ed3ef1
commit
9549a32d95
@ -24,10 +24,12 @@ type (
|
|||||||
MemberCount uint16
|
MemberCount uint16
|
||||||
MaxMemberCount uint16
|
MaxMemberCount uint16
|
||||||
Members []*GroupMemberInfo
|
Members []*GroupMemberInfo
|
||||||
|
// 最后一条信息的SEQ,只有通过 GetGroupInfo 函数获取的 GroupInfo 才会有
|
||||||
|
LastMsgSeq int64
|
||||||
|
|
||||||
client *QQClient
|
client *QQClient
|
||||||
lastMsgSeq int64
|
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupMemberInfo struct {
|
GroupMemberInfo struct {
|
||||||
@ -183,7 +185,7 @@ func decodeGroupInfoResponse(c *QQClient, _ uint16, payload []byte) (interface{}
|
|||||||
MemberCount: uint16(*info.GroupInfo.GroupMemberNum),
|
MemberCount: uint16(*info.GroupInfo.GroupMemberNum),
|
||||||
MaxMemberCount: uint16(*info.GroupInfo.GroupMemberMaxNum),
|
MaxMemberCount: uint16(*info.GroupInfo.GroupMemberMaxNum),
|
||||||
Members: []*GroupMemberInfo{},
|
Members: []*GroupMemberInfo{},
|
||||||
lastMsgSeq: int64(info.GroupInfo.GetGroupCurMsgSeq()),
|
LastMsgSeq: int64(info.GroupInfo.GetGroupCurMsgSeq()),
|
||||||
client: c,
|
client: c,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ func (c *QQClient) sendGroupMessage(groupCode int64, forward bool, m *message.Se
|
|||||||
return ret
|
return ret
|
||||||
case <-time.After(time.Second * 5):
|
case <-time.After(time.Second * 5):
|
||||||
if g, err := c.GetGroupInfo(groupCode); err == nil {
|
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 {
|
for _, m := range history {
|
||||||
if m.InternalId == mr {
|
if m.InternalId == mr {
|
||||||
return m
|
return m
|
||||||
|
Loading…
x
Reference in New Issue
Block a user