diff options
author | James Cook <james@lindenlab.com> | 2010-02-16 11:58:21 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-02-16 11:58:21 -0800 |
commit | 65d388d162dc14f5b8b3e0bfff1ae1125736f564 (patch) | |
tree | 2d6ac13cc54c6e4846b753248a409fd477540bce /indra/llui | |
parent | b34225a1918026ed8557a19cacf5925d107c134a (diff) |
Fix display of SLID-only accounts - prototype display name code was
putting duplicate name in parentheses.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llurlentry.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index dbfac63a72..ef48f6cd4f 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -326,12 +326,18 @@ void LLUrlEntryAgent::onNameCache(const LLUUID& id, { // IDEVO demo code LLAvatarName av_name; - LLAvatarNameCache::get(id, &av_name); - std::string label = av_name.mDisplayName + " (" + av_name.mSLID + ")"; - // use custom icon if available - std::string icon = (!av_name.mBadge.empty() ? av_name.mBadge : mIcon); - // received the agent name from the server - tell our observers - callObservers(id.asString(), label, icon); + if (LLAvatarNameCache::get(id, &av_name)) + { + std::string label = av_name.mDisplayName + " (" + av_name.mSLID + ")"; + // use custom icon if available + std::string icon = (!av_name.mBadge.empty() ? av_name.mBadge : mIcon); + // received the agent name from the server - tell our observers + callObservers(id.asString(), label, icon); + } + else + { + callObservers(id.asString(), full_name, mIcon); + } } std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb) @@ -358,9 +364,10 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa else if (gCacheName->getFullName(agent_id, full_name)) { LLAvatarName av_name; - LLAvatarNameCache::get(agent_id, &av_name); - std::string label = av_name.mDisplayName + " (" + av_name.mSLID + ")"; - return label; + if (LLAvatarNameCache::get(agent_id, &av_name)) + return av_name.mDisplayName + " (" + av_name.mSLID + ")"; + else + return full_name; } else { |