diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-09-01 22:22:08 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-09-01 22:22:08 -0400 |
commit | 07e30b9acda33ab0d4e266e40f71fb9df89963eb (patch) | |
tree | 843c3ec47369f6e8028574f638a27401dd20bfba /discord/discord.cpp | |
parent | 66747ec753c5f9a617d8bd342fbf015f7137cf49 (diff) | |
download | abaddon-portaudio-07e30b9acda33ab0d4e266e40f71fb9df89963eb.tar.gz abaddon-portaudio-07e30b9acda33ab0d4e266e40f71fb9df89963eb.zip |
send channel lazy load when loading thread if not previously sent
Diffstat (limited to 'discord/discord.cpp')
-rw-r--r-- | discord/discord.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp index 445cb65..7e61f54 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -476,9 +476,16 @@ void DiscordClient::SendLazyLoad(Snowflake id) { msg.ShouldGetThreads = true; m_websocket.Send(msg); + + m_channels_lazy_loaded.insert(id); } void DiscordClient::SendThreadLazyLoad(Snowflake id) { + auto thread = GetChannel(id); + if (thread.has_value()) + if (m_channels_lazy_loaded.find(*thread->ParentID) == m_channels_lazy_loaded.end()) + SendLazyLoad(*thread->ParentID); + LazyLoadRequestMessage msg; msg.GuildID = *GetChannel(id)->GuildID; msg.ThreadIDs.emplace().push_back(id); |