summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/discord/objects.cpp1
-rw-r--r--src/discord/objects.hpp1
-rw-r--r--src/windows/profilewindow.cpp7
3 files changed, 8 insertions, 1 deletions
diff --git a/src/discord/objects.cpp b/src/discord/objects.cpp
index 86264cc..715ae14 100644
--- a/src/discord/objects.cpp
+++ b/src/discord/objects.cpp
@@ -463,6 +463,7 @@ void from_json(const nlohmann::json &j, UserProfileData &m) {
JS_D("mutual_guilds", m.MutualGuilds);
JS_ON("premium_guild_since", m.PremiumGuildSince);
JS_ON("premium_since", m.PremiumSince);
+ JS_ON("legacy_username", m.LegacyUsername);
JS_D("user", m.User);
}
diff --git a/src/discord/objects.hpp b/src/discord/objects.hpp
index 3ad4037..4d56417 100644
--- a/src/discord/objects.hpp
+++ b/src/discord/objects.hpp
@@ -617,6 +617,7 @@ struct UserProfileData {
std::vector<MutualGuildData> MutualGuilds;
std::optional<std::string> PremiumGuildSince; // null
std::optional<std::string> PremiumSince; // null
+ std::optional<std::string> LegacyUsername; // null
UserData User;
friend void from_json(const nlohmann::json &j, UserProfileData &m);
diff --git a/src/windows/profilewindow.cpp b/src/windows/profilewindow.cpp
index ed8cd8a..72996aa 100644
--- a/src/windows/profilewindow.cpp
+++ b/src/windows/profilewindow.cpp
@@ -103,8 +103,13 @@ void ProfileWindow::OnFetchProfile(const UserProfileData &data) {
m_pane_info.SetProfile(data);
m_pane_guilds.SetMutualGuilds(data.MutualGuilds);
- for (auto child : m_badges.get_children())
+ if (data.LegacyUsername.has_value()) {
+ m_username.set_tooltip_text("Originally known as " + *data.LegacyUsername);
+ }
+
+ for (auto child : m_badges.get_children()) {
delete child;
+ }
if (!data.User.PublicFlags.has_value()) return;
const auto x = *data.User.PublicFlags;