summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-04-26 11:26:02 -0700
committerJames Cook <james@lindenlab.com>2010-04-26 11:26:02 -0700
commit7c913b91163cb2cb9e1829b523d1678a74230e93 (patch)
treef887ae9532abc534ccaf20748ec261193f22d640 /indra/newview
parentd89de271437f35f9d26e28409e6cc1d593a2fc7a (diff)
Fix inspector display name updating to help test server Display Names
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinspectavatar.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index 1bb9c42cbf..47b287b3ef 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -146,6 +146,8 @@ private:
void onNameCache(const LLUUID& id,
const std::string& name,
bool is_group);
+ void onAvatarNameCache(const LLUUID& agent_id,
+ const LLAvatarName& av_name);
private:
LLUUID mAvatarID;
@@ -332,6 +334,7 @@ void LLInspectAvatar::requestUpdate()
// Clear out old data so it doesn't flash between old and new
getChild<LLUICtrl>("user_name")->setValue("");
+ getChild<LLUICtrl>("user_slid")->setValue("");
getChild<LLUICtrl>("user_subtitle")->setValue("");
getChild<LLUICtrl>("user_details")->setValue("");
@@ -369,9 +372,19 @@ void LLInspectAvatar::requestUpdate()
childSetValue("avatar_icon", LLSD(mAvatarID) );
+ // JAMESDEBUG HACK: Request via both legacy name system and new
+ // name system to set mAvatarName for not-yet-converted friendship
+ // request system.
gCacheName->get(mAvatarID, false,
boost::bind(&LLInspectAvatar::onNameCache,
this, _1, _2, _3));
+
+ if (LLAvatarNameCache::useDisplayNames())
+ {
+ LLAvatarNameCache::get(mAvatarID,
+ boost::bind(&LLInspectAvatar::onAvatarNameCache,
+ this, _1, _2));
+ }
}
void LLInspectAvatar::processAvatarData(LLAvatarData* data)
@@ -614,14 +627,7 @@ void LLInspectAvatar::onNameCache(
mAvatarName = full_name;
// IDEVO JAMESDEBUG - need to always display a display name
- LLAvatarName av_name;
- if (LLAvatarNameCache::useDisplayNames()
- && LLAvatarNameCache::get(mAvatarID, &av_name))
- {
- getChild<LLUICtrl>("user_name")->setValue(av_name.mDisplayName);
- getChild<LLUICtrl>("user_slid")->setValue(av_name.mSLID);
- }
- else
+ if (!LLAvatarNameCache::useDisplayNames())
{
getChild<LLUICtrl>("user_name")->setValue(full_name);
getChild<LLUICtrl>("user_slid")->setValue("");
@@ -629,6 +635,18 @@ void LLInspectAvatar::onNameCache(
}
}
+void LLInspectAvatar::onAvatarNameCache(
+ const LLUUID& agent_id,
+ const LLAvatarName& av_name)
+{
+ if (agent_id == mAvatarID)
+ {
+ // JAMESDEBUG what to do about mAvatarName ?
+ getChild<LLUICtrl>("user_name")->setValue(av_name.mDisplayName);
+ getChild<LLUICtrl>("user_slid")->setValue(av_name.mSLID);
+ }
+}
+
void LLInspectAvatar::onClickAddFriend()
{
LLAvatarActions::requestFriendshipDialog(mAvatarID, mAvatarName);