summaryrefslogtreecommitdiff
path: root/indra/newview/llavatariconctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llavatariconctrl.cpp')
-rw-r--r--indra/newview/llavatariconctrl.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 44bf698caa..52bec5d434 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -245,7 +245,7 @@ void LLAvatarIconCtrl::setValue(const LLSD& value)
// messages. People API already hits the user table.
LLIconCtrl::setValue(mDefaultIconName, LLViewerFetchedTexture::BOOST_UI);
app->addObserver(mAvatarId, this);
- app->sendAvatarPropertiesRequest(mAvatarId);
+ app->sendAvatarLegacyPropertiesRequest(mAvatarId);
}
else if (gAgentID == mAvatarId)
{
@@ -299,9 +299,15 @@ bool LLAvatarIconCtrl::updateFromCache()
//virtual
void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type)
{
- if (APT_PROPERTIES == type)
+ // Both APT_PROPERTIES_LEGACY and APT_PROPERTIES have icon data.
+ // 'Legacy' is cheaper to request so LLAvatarIconCtrl issues that,
+ // but own icon should track any source for the sake of timely updates.
+ //
+ // If this needs to change, make sure to update onCommitProfileImage
+ // to issue right kind of request
+ if (APT_PROPERTIES_LEGACY == type)
{
- LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data);
+ LLAvatarLegacyData* avatar_data = static_cast<LLAvatarLegacyData*>(data);
if (avatar_data)
{
if (avatar_data->avatar_id != mAvatarId)
@@ -313,6 +319,20 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type)
updateFromCache();
}
}
+ else if (APT_PROPERTIES == type)
+ {
+ LLAvatarData* avatar_data = static_cast<LLAvatarData*>(data);
+ if (avatar_data)
+ {
+ if (avatar_data->avatar_id != mAvatarId)
+ {
+ return;
+ }
+
+ LLAvatarIconIDCache::getInstance()->add(mAvatarId, avatar_data->image_id);
+ updateFromCache();
+ }
+ }
}
void LLAvatarIconCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)