diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-10-04 23:19:46 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-10-04 23:19:46 -0400 |
commit | 8d7c1261aa9d7da0288c668b9b83390c19c74daa (patch) | |
tree | 59d0e4d55057a3cb51e23734745fd654f6aed68e | |
parent | 68f4578cb4c6855c73d697e4a644f522f1d2bc97 (diff) | |
download | abaddon-portaudio-8d7c1261aa9d7da0288c668b9b83390c19c74daa.tar.gz abaddon-portaudio-8d7c1261aa9d7da0288c668b9b83390c19c74daa.zip |
dont allow set token when connected
-rw-r--r-- | discord/discord.cpp | 6 | ||||
-rw-r--r-- | windows/mainwindow.cpp | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp index e4e115f..4d43486 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -364,8 +364,10 @@ void DiscordClient::LeaveGuild(Snowflake id) { } void DiscordClient::UpdateToken(std::string token) { - m_token = token; - m_http.SetAuth(token); + if (!IsStarted()) { + m_token = token; + m_http.SetAuth(token); + } } void DiscordClient::HandleGatewayMessageRaw(std::string str) { diff --git a/windows/mainwindow.cpp b/windows/mainwindow.cpp index e08f981..46fbb43 100644 --- a/windows/mainwindow.cpp +++ b/windows/mainwindow.cpp @@ -96,6 +96,7 @@ void MainWindow::UpdateComponents() { m_menu_discord_connect.set_sensitive(token.size() > 0 && !discord_active); m_menu_discord_disconnect.set_sensitive(discord_active); m_menu_discord_join_guild.set_sensitive(discord_active); + m_menu_discord_set_token.set_sensitive(!discord_active); if (!discord_active) { m_channel_list.Clear(); |