summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llappviewer.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index ec03377ccb..252c3adec0 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -283,6 +283,7 @@ using namespace LL;
#include <discordpp.h>
static std::shared_ptr<discordpp::Client> gDiscordClient;
static uint64_t gDiscordTimestampsStart;
+static std::string gDiscordActivityDetails;
static int32_t gDiscordPartyCurrentSize;
static int32_t gDiscordPartyMaxSize;
#endif
@@ -6041,13 +6042,16 @@ void LLAppViewer::updateDiscordActivity()
static LLCachedControl<bool> show_details(gSavedSettings, "ShowDiscordActivityDetails", false);
if (show_details)
{
- LLAvatarName av_name;
- LLAvatarNameCache::get(gAgent.getID(), &av_name);
- auto name = av_name.getUserName();
- auto displayName = av_name.getDisplayName();
- if (name != displayName)
- name = displayName + " (" + name + ")";
- activity.SetDetails(name);
+ if (gDiscordActivityDetails.empty())
+ {
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(gAgent.getID(), &av_name);
+ gDiscordActivityDetails = av_name.getUserName();
+ auto displayName = av_name.getDisplayName();
+ if (gDiscordActivityDetails != displayName)
+ gDiscordActivityDetails = displayName + " (" + gDiscordActivityDetails + ")";
+ }
+ activity.SetDetails(gDiscordActivityDetails);
}
static LLCachedControl<bool> show_state(gSavedSettings, "ShowDiscordActivityState", false);