show legacy username as tooltip under username
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user