From ad3c132bf1c074f473216cf1d05017a37ce9325f Mon Sep 17 00:00:00 2001 From: iProgramInCpp Date: Fri, 31 May 2024 16:30:40 +0300 Subject: [PATCH] * Fix bug where pronouns aren't being shown. --- src/discord/ProfileCache.cpp | 6 ++---- src/windows/ProfilePopout.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/discord/ProfileCache.cpp b/src/discord/ProfileCache.cpp index 5325734..ee128e9 100644 --- a/src/discord/ProfileCache.cpp +++ b/src/discord/ProfileCache.cpp @@ -58,13 +58,11 @@ Profile* ProfileCache::LoadProfile(Snowflake user, nlohmann::json& jx) if (iter != m_processingRequests.end()) m_processingRequests.erase(iter); - auto& userData = jx; - if (userData.contains("user")) - userData = jx["user"]; + auto& userData = jx.contains("user") ? jx["user"] : jx; pf->m_snowflake = user; pf->m_name = GetUsername(userData); - pf->m_discrim = userData.contains("discriminator") ? int(GetIntFromString(jx["discriminator"])) : 0; + pf->m_discrim = userData.contains("discriminator") ? int(GetIntFromString(userData["discriminator"])) : 0; pf->m_globalName = GetGlobalName(userData); pf->m_bIsBot = GetFieldSafeBool(userData, "bot", false); pf->m_bUsingDefaultData = false; diff --git a/src/windows/ProfilePopout.cpp b/src/windows/ProfilePopout.cpp index e4a8f0c..fc3c0f8 100644 --- a/src/windows/ProfilePopout.cpp +++ b/src/windows/ProfilePopout.cpp @@ -92,7 +92,7 @@ bool ProfilePopout::Layout(HWND hWnd, SIZE& fullSize) DrawText(hdc, userName, -1, &rcUserName, singleLineFlags); rcPronouns = rcMeasureTemplate; - rcPronouns.right = ScaleByDPI(100); // Max width for pronouns, if exists + rcPronouns.right = ScaleByDPI(70); // Max width for pronouns, if exists DrawText2(hdc, pronouns, -1, &rcPronouns, singleLineFlags); rcStatus = rcMeasureTemplate;