summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp40
-rwxr-xr-xindra/newview/llmarketplacefunctions.h1
2 files changed, 41 insertions, 0 deletions
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 15c1630a2a..701d341753 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -301,6 +301,29 @@ public:
}
}
};
+
+class LLSLMAssociateListingsResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLSLMAssociateListingsResponder);
+public:
+
+ LLSLMAssociateListingsResponder() {}
+
+ virtual void completed(U32 status, const std::string& reason, const LLSD& content) { }
+
+ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ {
+ if (isGoodStatus(status))
+ {
+ LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_MERCHANT);
+ }
+ else
+ {
+ log_SLM_error("Get merchant", status, reason, content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
// SLM Responders End
///////////////////////////////////////////////////////////////////////////////
@@ -902,6 +925,23 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id
}
// PUT /associate_inventory/:listing_folder_id/:version_folder_id/:listing_id
+void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id)
+{
+ LLSD headers = LLSD::emptyMap();
+ headers["Accept"] = "application/json";
+ headers["Content-Type"] = "application/json";
+
+ LLSD data = LLSD::emptyMap();
+
+ // Send request
+ std::string url = getSLMConnectURL("/associate_inventory/")
+ + folder_id.asString() + "/"
+ + version_id.asString() + "/"
+ + llformat("%d",listing_id);
+
+ llinfos << "Merov : associate listing : " << url << llendl;
+ LLHTTPClient::put(url, data, new LLSLMAssociateListingsResponder(), headers);
+}
std::string LLMarketplaceData::getSLMConnectURL(const std::string& route)
{
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index f0a1f2f4b8..3be1abf24f 100755
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -165,6 +165,7 @@ public:
//void getSLMListing();
void createSLMListing(const LLUUID& folder_id);
void updateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed);
+ void associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id);
bool isEmpty() { return (mMarketplaceItems.size() == 0); }