summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-06-11 21:25:32 -0700
committerMerov Linden <merov@lindenlab.com>2014-06-11 21:25:32 -0700
commit140d5f0a22ab531f92b4a3a66c8229f550e1ff5c (patch)
tree0cc68023531889c4db975c40601cc259310ffd65
parent10dc6854a8f677c206aa9d3595f63223d542260e (diff)
DD-98 : Add message with link to marketplace if listing cannot be edited
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp21
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml11
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
@@ -346,6 +346,17 @@ Initialization with the Marketplace failed because of a system or network error.
</notification>
<notification
+ icon="alertmodal.tga"
+ name="AlertMerchantListingNotUpdated"
+ type="alertmodal">
+This listing could not be updated.
+[[URL] Click here] to edit it on the Marketplace.
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
icon="alertmodal.tga"
name="CompileQueueSaveText"
type="alertmodal">