diff options
-rw-r--r-- | indra/newview/llinspectavatar.cpp | 34 |
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); |