From 140d5f0a22ab531f92b4a3a66c8229f550e1ff5c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 11 Jun 2014 21:25:32 -0700 Subject: DD-98 : Add message with link to marketplace if listing cannot be edited --- indra/newview/llmarketplacefunctions.cpp | 21 +++++++++++++++++++-- .../newview/skins/default/xui/en/notifications.xml | 11 +++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index fe67683de5..d6a4d4062f 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -33,6 +33,7 @@ #include "llhttpclient.h" #include "llinventoryfunctions.h" #include "llinventoryobserver.h" +#include "llnotificationsutil.h" #include "llsdserialize.h" #include "lltimer.h" #include "lltrans.h" @@ -333,7 +334,11 @@ class LLSLMUpdateListingsResponder : public LLHTTPClient::Responder LOG_CLASS(LLSLMUpdateListingsResponder); public: - LLSLMUpdateListingsResponder() {} + LLSLMUpdateListingsResponder(bool expected_listed_state, const LLUUID& expected_version_id) + { + mExpectedListedState = expected_listed_state; + mExpectedVersionUUID = expected_version_id; + } virtual void completedRaw(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) @@ -381,9 +386,21 @@ public: LLMarketplaceData::instance().setActivationState(folder_id, is_listed); LLMarketplaceData::instance().setListingURL(folder_id, edit_url); + // Show a notification alert if what we got is not what we expected + // (this actually doesn't result in an error status from the SLM API protocol) + if ((mExpectedListedState != is_listed) || (mExpectedVersionUUID != version_id)) + { + LLSD subs; + subs["[URL]"] = edit_url; + LLNotificationsUtil::add("AlertMerchantListingNotUpdated", subs); + } + it++; } } +private: + bool mExpectedListedState; + LLUUID mExpectedVersionUUID; }; class LLSLMAssociateListingsResponder : public LLHTTPClient::Responder @@ -1118,7 +1135,7 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id // Send request std::string url = getSLMConnectURL("/listing/") + llformat("%d",listing_id); log_SLM_infos("LLHTTPClient::putRaw", url, json_str); - LLHTTPClient::putRaw(url, data, size, new LLSLMUpdateListingsResponder(), headers); + LLHTTPClient::putRaw(url, data, size, new LLSLMUpdateListingsResponder(is_listed, version_id), headers); } void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e30f42ae98..11c3ca14d0 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -345,6 +345,17 @@ Initialization with the Marketplace failed because of a system or network error. yestext="OK"/> + +This listing could not be updated. +[[URL] Click here] to edit it on the Marketplace. + + +