diff options
Diffstat (limited to 'indra/newview/llinspectavatar.cpp')
-rw-r--r-- | indra/newview/llinspectavatar.cpp | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index b2cdc0738f..41dbeab5a7 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -138,11 +138,9 @@ private: bool isNotFriend(); // Callback for gCacheName to look up avatar name - void nameUpdatedCallback( - const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group); + void onNameCache(const LLUUID& id, + const std::string& name, + bool is_group); private: LLUUID mAvatarID; @@ -360,9 +358,9 @@ void LLInspectAvatar::requestUpdate() childSetValue("avatar_icon", LLSD(mAvatarID) ); - gCacheName->get(mAvatarID, FALSE, - boost::bind(&LLInspectAvatar::nameUpdatedCallback, - this, _1, _2, _3, _4)); + gCacheName->get(mAvatarID, false, + boost::bind(&LLInspectAvatar::onNameCache, + this, _1, _2, _3)); } void LLInspectAvatar::processAvatarData(LLAvatarData* data) @@ -603,16 +601,26 @@ void LLInspectAvatar::onVolumeChange(const LLSD& data) gVoiceClient->setUserVolume(mAvatarID, volume); } -void LLInspectAvatar::nameUpdatedCallback( +void LLInspectAvatar::onNameCache( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) + const std::string& name, + bool is_group) { if (id == mAvatarID) { - mAvatarName = first + " " + last; - childSetValue("user_name", LLSD(mAvatarName) ); + mAvatarName = name; + + // IDEVO JAMESDEBUG - need to always display a display name + std::string display_name; + if (gCacheName->getDisplayName(mAvatarID, display_name)) + { + getChild<LLUICtrl>("user_name")->setValue(display_name); + } + else + { + getChild<LLUICtrl>("user_name")->setValue(name); + } + getChild<LLUICtrl>("user_slid")->setValue(name); } } |