Skip to content

Commit

Permalink
* Fix bug where pronouns aren't being shown.
Browse files Browse the repository at this point in the history
  • Loading branch information
iProgramMC committed May 31, 2024
1 parent 081c32a commit ad3c132
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/discord/ProfileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/windows/ProfilePopout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ad3c132

Please sign in to comment.