diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-01-03 19:01:33 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-01-03 19:01:33 -0500 |
commit | 4740965f4c1ee879a733b4068f4026a0dfa626fd (patch) | |
tree | bf3f3e4cbac1e63fe9ef4f5191e553e8ce615fd7 /src/discord/discord.cpp | |
parent | 6ff2563e36eac4f90ba241df3937980abd73c579 (diff) | |
download | abaddon-portaudio-4740965f4c1ee879a733b4068f4026a0dfa626fd.tar.gz abaddon-portaudio-4740965f4c1ee879a733b4068f4026a0dfa626fd.zip |
rewrite DiscordVoiceClient and stuff
Diffstat (limited to 'src/discord/discord.cpp')
-rw-r--r-- | src/discord/discord.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/discord/discord.cpp b/src/discord/discord.cpp index cd16aa8..c068243 100644 --- a/src/discord/discord.cpp +++ b/src/discord/discord.cpp @@ -1194,10 +1194,14 @@ void DiscordClient::DisconnectFromVoice() { m_websocket.Send(m); } -bool DiscordClient::IsConnectedToVoice() const noexcept { +bool DiscordClient::IsVoiceConnected() const noexcept { return m_voice.IsConnected(); } +bool DiscordClient::IsVoiceConnecting() const noexcept { + return m_voice.IsConnecting(); +} + Snowflake DiscordClient::GetVoiceChannelID() const noexcept { return m_voice_channel_id; } @@ -2174,7 +2178,7 @@ void DiscordClient::HandleGatewayVoiceStateUpdate(const GatewayMessage &msg) { m_voice.SetSessionID(data.SessionID); // channel_id = null means disconnect. stop cuz out of order maybe - if (!data.ChannelID.has_value()) { + if (!data.ChannelID.has_value() && (m_voice.IsConnected() || m_voice.IsConnecting())) { m_voice.Stop(); } } else { |