diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-05-18 20:23:00 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-05-18 20:23:00 -0400 |
commit | 15aa8758570c1eb848d67496072ea00d447367d6 (patch) | |
tree | 62d6b0dd0ae585f05ab073049d56fe6d4414d41f /src | |
parent | d0fa9cc289d8398a27ddf2a66783b5d460e2210a (diff) | |
parent | 38c3b0c2aadc3360a8420f3394b63a4dfa4dd059 (diff) | |
download | abaddon-portaudio-15aa8758570c1eb848d67496072ea00d447367d6.tar.gz abaddon-portaudio-15aa8758570c1eb848d67496072ea00d447367d6.zip |
Merge branch 'master' into voice
Diffstat (limited to 'src')
-rw-r--r-- | src/discord/discord.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp index 40c900b..be939be 100644 --- a/src/discord/discord.cpp +++ b/src/discord/discord.cpp @@ -2305,7 +2305,8 @@ void DiscordClient::HandleGatewayVoiceServerUpdate(const GatewayMessage &msg) { void DiscordClient::HandleGatewayReadySupplemental(const GatewayMessage &msg) { ReadySupplementalData data = msg.Data; - for (const auto &p : data.MergedPresences.Friends) { + + const auto handle_presence = [this](const MergedPresence &p) { const auto user = GetUser(p.UserID); if (!user.has_value()) return; // should be sent in READY's `users` const auto s = p.Presence.Status; @@ -2318,6 +2319,15 @@ void DiscordClient::HandleGatewayReadySupplemental(const GatewayMessage &msg) { else if (s == "dnd") m_user_to_status[p.UserID] = PresenceStatus::DND; m_signal_presence_update.emit(*user, m_user_to_status.at(p.UserID)); + }; + + for (const auto &p : data.MergedPresences.Friends) { + handle_presence(p); + } + for (const auto &g : data.MergedPresences.Guilds) { + for (const auto &p : g) { + handle_presence(p); + } } #ifdef WITH_VOICE for (const auto &g : data.Guilds) { |