diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-14 03:05:16 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-14 03:05:16 -0500 |
commit | 22578921b9e577c669cd57385df48cfc08fa90eb (patch) | |
tree | c4a70fa7eb2682e5380e0411df857dd854993fec /abaddon.cpp | |
parent | 33ed25b2f66e727911182f1552aa8abfd558c69e (diff) | |
download | abaddon-portaudio-22578921b9e577c669cd57385df48cfc08fa90eb.tar.gz abaddon-portaudio-22578921b9e577c669cd57385df48cfc08fa90eb.zip |
pretend to be a real client a little better
Diffstat (limited to 'abaddon.cpp')
-rw-r--r-- | abaddon.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/abaddon.cpp b/abaddon.cpp index ce9deeb..a640e78 100644 --- a/abaddon.cpp +++ b/abaddon.cpp @@ -21,7 +21,7 @@ Abaddon::Abaddon() LoadFromSettings(); // todo: set user agent for non-client(?) - std::string ua = m_settings.GetSettingString("http", "user_agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.308 Chrome/78.0.3904.130 Electron/7.3.2 Safari/537.36"); + std::string ua = m_settings.GetSettingString("http", "user_agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36"); m_discord.SetUserAgent(ua); m_discord.signal_gateway_ready().connect(sigc::mem_fun(*this, &Abaddon::DiscordOnReady)); @@ -301,10 +301,11 @@ void Abaddon::ActionChannelOpened(Snowflake id) { m_main_window->set_title(std::string(APP_TITLE) + " - #" + *channel->Name); else { std::string display; - if (channel->Recipients->size() > 1) - display = std::to_string(channel->Recipients->size()) + " users"; + const auto recipients = channel->GetDMRecipients(); + if (recipients.size() > 1) + display = std::to_string(recipients.size()) + " users"; else - display = channel->Recipients.value()[0].Username; + display = recipients[0].Username; m_main_window->set_title(std::string(APP_TITLE) + " - " + display); } m_main_window->UpdateChatActiveChannel(id); |