summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-10-21 21:46:16 -0700
committerMerov Linden <merov@lindenlab.com>2014-10-21 21:46:16 -0700
commitf99dbd9be0f631ee9135ac89d8322c359711d626 (patch)
treeb4e6611debc3020057f580b7eaaebfe4fd201bdf /indra
parenteeb5fb382bdb45c4c886a113506b777e85cbf4e2 (diff)
DD-224 : WIP : Add a deleteListing method, call SLM_UPDATE_FOLDER notification if state is deleted
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp11
-rwxr-xr-xindra/newview/llmarketplacefunctions.h1
-rwxr-xr-xindra/newview/llviewermessage.cpp13
3 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 4bf0eac03b..5e4615dbda 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -1487,6 +1487,17 @@ bool LLMarketplaceData::deleteListing(const LLUUID& folder_id, bool update_slm)
return true;
}
+bool LLMarketplaceData::deleteListing(S32 listing_id)
+{
+ if (listing_id == 0)
+ {
+ return false;
+ }
+
+ LLUUID folder_id = getListingFolder(listing_id);
+ return deleteListing(folder_id);
+}
+
// Accessors
bool LLMarketplaceData::getActivationState(const LLUUID& folder_id)
{
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index 18ff313555..c2b287eea9 100755
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -197,6 +197,7 @@ public:
bool associateListing(const LLUUID& folder_id, const LLUUID& source_folder_id, S32 listing_id);
bool getListing(const LLUUID& folder_id);
bool getListing(S32 listing_id);
+ bool deleteListing(S32 listing_id);
// Probe the Marketplace data set to identify folders
bool isListed(const LLUUID& folder_id); // returns true if folder_id is a Listing folder
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 871ed8c0df..931b16ccb7 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5968,9 +5968,18 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
// Special Marketplace update notification
if (notificationID == "SLM_UPDATE_FOLDER")
{
+ std::string state = llsdBlock["state"].asString();
+ llinfos << "Merov : SLM_UPDATE_FOLDER, state = " << state << ", id = " << llsdBlock["listing_id"].asInteger() << llendl;
// In general, no message will be displayed, all we want is to get the listing updated in the marketplace floater
- // If getListing() fails though, the message of the alert will be shown by the caller of attempt_standard_notification()
- return LLMarketplaceData::instance().getListing(llsdBlock["listing_id"].asInteger());
+ // If getListing() or deleteListing() fails though, the message of the alert will be shown by the caller of attempt_standard_notification()
+ if (state == "deleted")
+ {
+ return LLMarketplaceData::instance().deleteListing(llsdBlock["listing_id"].asInteger());
+ }
+ else
+ {
+ return LLMarketplaceData::instance().getListing(llsdBlock["listing_id"].asInteger());
+ }
}
LLNotificationsUtil::add(notificationID, llsdBlock);