summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-08-23 17:31:33 -0700
committerMerov Linden <merov@lindenlab.com>2014-08-23 17:31:33 -0700
commitc77575df2f91452ad1a527f2f46ba1191459b259 (patch)
treefa817207ce76d8a11a01bf55fccd8738b8b1b0f0 /indra/newview
parentc4ad85ecb9c85cdbedec6c297ae3ab2bc5eb554b (diff)
DD-122 : Fixed. Unlist if listing doesn't validate after move
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llinventorybridge.cpp22
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp7
-rwxr-xr-xindra/newview/llmarketplacefunctions.h1
3 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 60474dd125..d6ad9b50a4 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2568,6 +2568,17 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
if (move_is_from_marketplacelistings)
{
+ // If we move from an active (listed) listing, checks that it's still valid, if not, unlist
+ LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid);
+ if (version_folder_id.notNull())
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id);
+ if (!validate_marketplacelistings(cat,NULL))
+ {
+ LLMarketplaceData::instance().activateListing(version_folder_id,false);
+ }
+ }
+ // Update the listing we moved from anyway
update_marketplace_category(from_folder_uuid);
// Clear the folder from the marketplace in case it is a listing folder
if (LLMarketplaceData::instance().isListed(cat_id))
@@ -4368,6 +4379,17 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
if (move_is_from_marketplacelistings)
{
+ // If we move from an active (listed) listing, checks that it's still valid, if not, unlist
+ LLUUID version_folder_id = LLMarketplaceData::instance().getActiveFolder(from_folder_uuid);
+ if (version_folder_id.notNull())
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(version_folder_id);
+ if (!validate_marketplacelistings(cat,NULL))
+ {
+ LLMarketplaceData::instance().activateListing(version_folder_id,false);
+ }
+ }
+ // Update the listing we moved from anyway
update_marketplace_category(from_folder_uuid);
}
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index a23295ec20..669c49ea4f 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -1459,6 +1459,13 @@ bool LLMarketplaceData::isInActiveFolder(const LLUUID& obj_id)
return (active && ((obj_id == version_uuid) || gInventory.isObjectDescendentOf(obj_id, version_uuid)));
}
+LLUUID LLMarketplaceData::getActiveFolder(const LLUUID& obj_id)
+{
+ S32 depth = depth_nesting_in_marketplace(obj_id);
+ LLUUID listing_uuid = nested_parent_id(obj_id, depth);
+ return (getActivationState(listing_uuid) ? getVersionFolder(listing_uuid) : LLUUID::null);
+}
+
// Private Modifiers
bool LLMarketplaceData::setListingID(const LLUUID& folder_id, S32 listing_id)
{
diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h
index e40eca9176..5f72f6e78e 100755
--- a/indra/newview/llmarketplacefunctions.h
+++ b/indra/newview/llmarketplacefunctions.h
@@ -200,6 +200,7 @@ public:
bool isListedAndActive(const LLUUID& folder_id); // returns true if folder_id is an active (listed) Listing folder
bool isVersionFolder(const LLUUID& folder_id); // returns true if folder_id is a Version folder
bool isInActiveFolder(const LLUUID& obj_id); // returns true if the obj_id is buried in an active version folder
+ LLUUID getActiveFolder(const LLUUID& obj_id); // returns the UUID of the active version folder obj_id is in
// Access Marketplace data set : each method returns a default value if the argument can't be found
bool getActivationState(const LLUUID& folder_id);