summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2012-11-15 15:20:05 -0500
committerLogan Dethrow <log@lindenlab.com>2012-11-15 15:20:05 -0500
commitf93604c399c889e06980554e1cb59a833e7f847d (patch)
treeabc29aff3a2254369c0f3a594f7e76b99522bc7e /indra/newview/llpaneleditwearable.cpp
parenta55fff2c60eae842c99a95765b28e894edb9ddfb (diff)
WIP Working on adding http request to increment the COF version when a change is made to an item in an agent's current outfit folder. SH-3339
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r--indra/newview/llpaneleditwearable.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 7832156a0e..9862c98cc8 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -1028,6 +1028,46 @@ void LLPanelEditWearable::updatePanelPickerControls(LLWearableType::EType type)
}
}
+//static
+void LLPanelEditWearable::incrementCofVersion()
+{
+ // Create a response handler
+ LLHTTPClient::ResponderPtr responderPtr = LLHTTPClient::ResponderPtr(new LLMaturityPreferencesResponder(this));
+
+ // Look up the capability to POST to.
+ std::string url = gAgent.getRegion()->getCapability("IncrementCofVersion");
+
+ // If we don't have a region, report it as an error
+ if (getRegion() == NULL)
+ {
+ responderPtr->error(0U, "region is not defined");
+ }
+ else
+ {
+ // Find the capability to send maturity preference
+ std::string url = getRegion()->getCapability("UpdateAgentInformation");
+
+ // If the capability is not defined, report it as an error
+ if (url.empty())
+ {
+ responderPtr->error(0U, "capability 'UpdateAgentInformation' is not defined for region");
+ }
+ else
+ {
+ // Set new access preference
+ LLSD access_prefs = LLSD::emptyMap();
+ access_prefs["max"] = LLViewerRegion::accessToShortString(pPreferredMaturity);
+
+ LLSD body = LLSD::emptyMap();
+ body["access_prefs"] = access_prefs;
+ llinfos << "Sending viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreferredMaturity)
+ << "' via capability to: " << url << llendl;
+ LLSD headers;
+ LLHTTPClient::post(url, body, responderPtr, headers, 30.0f);
+ }
+ }
+}
+
void LLPanelEditWearable::saveChanges(bool force_save_as)
{
if (!mWearablePtr || !isDirty())
@@ -1050,6 +1090,8 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
{
gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name);
}
+
+ LLPanelEditWearable::incrementCofVersion();
}
void LLPanelEditWearable::revertChanges()