summaryrefslogtreecommitdiff
path: root/indra/newview/llavatariconctrl.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-05-25 14:22:56 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-05-25 14:22:56 -0700
commit16e3d7ebf56731c5e9ff40b92eff427316c65103 (patch)
tree62552614f1314f4d3bb96ef133b9659bdae89e16 /indra/newview/llavatariconctrl.cpp
parent1bd6061ff57a46293d962adf8ffa5326f87a3566 (diff)
parenta91d10dc1806d1931c7f1361bfcf70df59d982d5 (diff)
Merge
Diffstat (limited to 'indra/newview/llavatariconctrl.cpp')
-rw-r--r--indra/newview/llavatariconctrl.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 11cc456695..f4d5d45726 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -34,17 +34,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
@@ -233,6 +235,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);
@@ -244,8 +249,9 @@ void LLAvatarIconCtrl::setValue(const LLSD& value)
LLIconCtrl::setValue(value);
}
- gCacheName->get(mAvatarId, false,
- boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3));
+ LLAvatarNameCache::get(mAvatarId,
+ boost::bind(&LLAvatarIconCtrl::onAvatarNameCache,
+ this, _1, _2));
}
bool LLAvatarIconCtrl::updateFromCache()
@@ -288,18 +294,17 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type)
}
}
-void LLAvatarIconCtrl::nameUpdatedCallback(
- const LLUUID& id,
- const std::string& name,
- bool is_group)
+void LLAvatarIconCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
{
- if (id == mAvatarId)
+ if (agent_id == mAvatarId)
{
- mFullName = name;
+ // 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(name);
+ setToolTip(mFullName);
}
else
{