summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelprofile.cpp')
-rw-r--r--indra/newview/llpanelprofile.cpp44
1 files changed, 33 insertions, 11 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 7aabd5247a..0c2ec017b5 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -276,9 +276,9 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id)
//TODO: changes take two minutes to propagate!
// Add some storage that holds updated data for two minutes
// for new instances to reuse the data
-// Profile data is only relevant to won avatar, but notes
-// are for everybody
-void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLSD data)
+// Profile data is only relevant to own avatar, but notes
+// are for everybody (no onger an issue?)
+void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLSD data, std::function<void(bool)> callback)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
@@ -299,10 +299,16 @@ void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLSD data)
if (!status)
{
LL_WARNS("AvatarProperties") << "Failed to put agent information " << data << " for id " << agent_id << LL_ENDL;
- return;
+ }
+ else
+ {
+ LL_DEBUGS("AvatarProperties") << "Agent id: " << agent_id << " Data: " << data << " Result: " << httpResults << LL_ENDL;
}
- LL_DEBUGS("AvatarProperties") << "Agent id: " << agent_id << " Data: " << data << " Result: " << httpResults << LL_ENDL;
+ if (callback)
+ {
+ callback(status);
+ }
}
LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::string path_to_image, LLHandle<LLPanel> *handle)
@@ -447,6 +453,13 @@ void post_profile_image_coro(std::string cap_url, EProfileImageType type, std::s
}
}
+ if (type == PROFILE_IMAGE_SL && result.notNull())
+ {
+ LLAvatarIconIDCache::getInstance()->add(gAgentID, result);
+ // Should trigger callbacks in icon controls
+ LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgentID);
+ }
+
// Cleanup
LLFile::remove(path_to_image);
delete handle;
@@ -1827,7 +1840,7 @@ void LLPanelProfileSecondLife::onShowInSearchCallback()
LLSD data;
data["allow_publish"] = mAllowPublish;
LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), data));
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), data, nullptr));
}
else
{
@@ -1842,7 +1855,7 @@ void LLPanelProfileSecondLife::onSaveDescriptionChanges()
if (!cap_url.empty())
{
LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("sl_about_text", mDescriptionText)));
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("sl_about_text", mDescriptionText), nullptr));
}
else
{
@@ -2003,10 +2016,19 @@ void LLPanelProfileSecondLife::onCommitProfileImage(const LLUUID& id)
std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
if (!cap_url.empty())
{
+ std::function<void(bool)> callback = [id](bool result)
+ {
+ if (result)
+ {
+ LLAvatarIconIDCache::getInstance()->add(gAgentID, id);
+ // Should trigger callbacks in icon controls
+ LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgentID);
+ }
+ };
LLSD params;
params["sl_image_id"] = id;
LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params));
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params, callback));
mImageId = id;
if (mImageId == LLUUID::null)
@@ -2357,7 +2379,7 @@ void LLPanelProfileFirstLife::onCommitPhoto(const LLUUID& id)
LLSD params;
params["fl_image_id"] = id;
LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params));
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params, nullptr));
mImageId = id;
if (mImageId.notNull())
@@ -2401,7 +2423,7 @@ void LLPanelProfileFirstLife::onSaveDescriptionChanges()
if (!cap_url.empty())
{
LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("fl_about_text", mCurrentDescription)));
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("fl_about_text", mCurrentDescription), nullptr));
}
else
{
@@ -2544,7 +2566,7 @@ void LLPanelProfileNotes::onSaveNotesChanges()
if (!cap_url.empty())
{
LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("notes", mCurrentNotes)));
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("notes", mCurrentNotes), nullptr));
}
else
{