From 70956fb2dbc42501d27a474e3f80003d591ee646 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Sat, 14 Oct 2023 00:11:06 +0200 Subject: SL-20163 Allow residents to hide exact join date on profiles --- indra/newview/llpanelavatar.cpp | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'indra/newview/llpanelavatar.cpp') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index ff33efe4aa..626978f9fb 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -127,6 +127,48 @@ void LLPanelProfileTab::setApplyProgress(bool started) } } +static void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLSD data) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("put_avatar_properties_coro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpHeaders::ptr_t httpHeaders; + + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setFollowRedirects(true); + + std::string finalUrl = cap_url + "/" + agent_id.asString(); + + LLSD result = httpAdapter->putAndSuspend(httpRequest, finalUrl, data, httpOpts, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("AvatarProperties") << "Failed to put agent information " << data << " for id " << agent_id << LL_ENDL; + return; + } + + LL_DEBUGS("AvatarProperties") << "Agent id: " << agent_id << " Data: " << data << " Result: " << httpResults << LL_ENDL; +} + +bool LLPanelProfileTab::saveAgentUserInfoCoro(std::string name, LLSD value) const +{ + std::string cap_url = gAgent.getRegionCapability("AgentProfile"); + if (cap_url.empty()) + { + LL_WARNS("AvatarProperties") << "Failed to update profile data, no cap found" << LL_ENDL; + return false; + } + + LLCoros::instance().launch("putAgentUserInfoCoro", + boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with(name, value))); + + return true; +} + LLPanelProfilePropertiesProcessorTab::LLPanelProfilePropertiesProcessorTab() : LLPanelProfileTab() { -- cgit v1.2.3 From 69aa02d2e1873970302942487b96d3a6aca119e5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 24 Oct 2023 23:02:56 +0300 Subject: SL-20513 Make profile floater use properties processor #3 --- indra/newview/llpanelavatar.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llpanelavatar.cpp') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 626978f9fb..ad8ed7c144 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -194,3 +194,13 @@ void LLPanelProfilePropertiesProcessorTab::setAvatarId(const LLUUID & avatar_id) LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); } } + +void LLPanelProfilePropertiesProcessorTab::updateData() +{ + LLUUID avatar_id = getAvatarId(); + if (!getStarted() && avatar_id.notNull()) + { + setIsLoading(); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(getAvatarId()); + } +} -- cgit v1.2.3 From 7838c14d871529b39e0fdf63088ac7640478605c Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 18 Dec 2023 22:02:14 +0200 Subject: SL-18058 Post-merge functionality restore --- indra/newview/llpanelavatar.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelavatar.cpp') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index ad8ed7c144..3f2dc5a415 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -127,7 +127,7 @@ void LLPanelProfileTab::setApplyProgress(bool started) } } -static void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLSD data) +static void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLSD data, std::function callback) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -148,13 +148,19 @@ static void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLS 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); + } } -bool LLPanelProfileTab::saveAgentUserInfoCoro(std::string name, LLSD value) const +bool LLPanelProfileTab::saveAgentUserInfoCoro(std::string name, LLSD value, std::function callback) const { std::string cap_url = gAgent.getRegionCapability("AgentProfile"); if (cap_url.empty()) @@ -164,7 +170,7 @@ bool LLPanelProfileTab::saveAgentUserInfoCoro(std::string name, LLSD value) cons } LLCoros::instance().launch("putAgentUserInfoCoro", - boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with(name, value))); + boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with(name, value), callback)); return true; } -- cgit v1.2.3