mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
protocol: use FetchChannelList to fill channel list field
This commit is contained in:
parent
8de7862072
commit
551a865d9e
@ -431,6 +431,9 @@ func decodeGuildPushFirstView(c *QQClient, _ *incomingPacketInfo, payload []byte
|
|||||||
CoverUrl: fmt.Sprintf("https://groupprocover-76483.picgzc.qpic.cn/%v", guild.GetGuildId()),
|
CoverUrl: fmt.Sprintf("https://groupprocover-76483.picgzc.qpic.cn/%v", guild.GetGuildId()),
|
||||||
AvatarUrl: fmt.Sprintf("https://groupprohead-76292.picgzc.qpic.cn/%v", guild.GetGuildId()),
|
AvatarUrl: fmt.Sprintf("https://groupprohead-76292.picgzc.qpic.cn/%v", guild.GetGuildId()),
|
||||||
}
|
}
|
||||||
|
channels, err := c.GuildService.FetchChannelList(info.GuildId)
|
||||||
|
if err != nil {
|
||||||
|
c.Warning("waring: fetch guild %v channel error %v. will use sync node to fill channel list field")
|
||||||
for _, node := range guild.ChannelNodes {
|
for _, node := range guild.ChannelNodes {
|
||||||
meta := new(channel.ChannelMsgMeta)
|
meta := new(channel.ChannelMsgMeta)
|
||||||
_ = proto.Unmarshal(node.Meta, meta)
|
_ = proto.Unmarshal(node.Meta, meta)
|
||||||
@ -444,9 +447,11 @@ func decodeGuildPushFirstView(c *QQClient, _ *incomingPacketInfo, payload []byte
|
|||||||
AtAllSeq: meta.GetAtAllSeq(),
|
AtAllSeq: meta.GetAtAllSeq(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
info.Channels = channels
|
||||||
|
}
|
||||||
info.Bots, info.Members, info.Admins, _ = c.GuildService.GetGuildMembers(info.GuildId)
|
info.Bots, info.Members, info.Admins, _ = c.GuildService.GetGuildMembers(info.GuildId)
|
||||||
c.GuildService.Guilds = append(c.GuildService.Guilds, info)
|
c.GuildService.Guilds = append(c.GuildService.Guilds, info)
|
||||||
c.GuildService.FetchChannelList(info.GuildId)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(firstViewMsg.ChannelMsgs) > 0 { // sync msg
|
if len(firstViewMsg.ChannelMsgs) > 0 { // sync msg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user