summaryrefslogtreecommitdiff
path: root/indra/newview/llavatariconctrl.cpp
diff options
context:
space:
mode:
authorTofu Buzzard <no-email>2010-10-15 09:52:11 +0100
committerTofu Buzzard <no-email>2010-10-15 09:52:11 +0100
commitad033a4b35387a343f2204cda64ecb590888b60e (patch)
tree6b2191d8e082bc84e28b2bbaa4dcea95cf68a797 /indra/newview/llavatariconctrl.cpp
parent393c819477b268aa0a05ec0a006e1dba27d6e6c6 (diff)
parent508686047d5e98934d5fefbb576e54f108df6fe3 (diff)
sync up to viewer-developer
Diffstat (limited to 'indra/newview/llavatariconctrl.cpp')
-rw-r--r--indra/newview/llavatariconctrl.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 09fbed9e06..d0f4d19f56 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -28,17 +28,19 @@
#include "llavatariconctrl.h"
+// viewer includes
#include "llagent.h"
#include "llavatarconstants.h"
#include "llcallingcard.h" // for LLAvatarTracker
#include "llavataractions.h"
#include "llmenugl.h"
#include "lluictrlfactory.h"
-
-#include "llcachename.h"
#include "llagentdata.h"
#include "llimfloater.h"
+// library includes
+#include "llavatarnamecache.h"
+
#define MENU_ITEM_VIEW_PROFILE 0
#define MENU_ITEM_SEND_IM 1
@@ -227,6 +229,9 @@ void LLAvatarIconCtrl::setValue(const LLSD& value)
// Check if cache already contains image_id for that avatar
if (!updateFromCache())
{
+ // *TODO: Consider getting avatar icon/badge directly from
+ // People API, rather than sending AvatarPropertyRequest
+ // messages. People API already hits the user table.
LLIconCtrl::setValue(mDefaultIconName);
app->addObserver(mAvatarId, this);
app->sendAvatarPropertiesRequest(mAvatarId);
@@ -238,10 +243,9 @@ void LLAvatarIconCtrl::setValue(const LLSD& value)
LLIconCtrl::setValue(value);
}
- if (gCacheName)
- {
- gCacheName->get(mAvatarId, FALSE, boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3, _4));
- }
+ LLAvatarNameCache::get(mAvatarId,
+ boost::bind(&LLAvatarIconCtrl::onAvatarNameCache,
+ this, _1, _2));
}
bool LLAvatarIconCtrl::updateFromCache()
@@ -284,24 +288,21 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type)
}
}
-void LLAvatarIconCtrl::nameUpdatedCallback(
- const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group)
+void LLAvatarIconCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
{
- if (id == mAvatarId)
+ if (agent_id == mAvatarId)
{
- mFirstName = first;
- mLastName = last;
+ // Most avatar icon controls are next to a UI element that shows
+ // a display name, so only show username.
+ mFullName = av_name.mUsername;
if (mDrawTooltip)
{
- setToolTip(mFirstName + " " + mLastName);
+ setToolTip(mFullName);
}
else
{
- setToolTip(std::string(""));
+ setToolTip(std::string());
}
}
}