diff options
author | Merov Linden <merov@lindenlab.com> | 2014-04-11 14:58:12 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-04-11 14:58:12 -0700 |
commit | 1b4408e59d6798e2916ce9bcbedbd729fde0d959 (patch) | |
tree | 31b6997f9d4f43087c776935dc2be31c82963476 /indra/newview | |
parent | 45ec0833c2f11b7c59b6e250fd63f55fb2317cb5 (diff) |
DD-59 : WIP : Added marketplace consitency check and cleaning when updating a marketplace folder
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 757dcb4992..0aba4f57a0 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -155,8 +155,8 @@ void update_marketplace_category(const LLUUID& cat_id) const LLUUID marketplace_listings_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); // No marketplace -> likely called too early... or - // Not a descendent of the marketplace listings root -> likely called in error then... - if (marketplace_listings_uuid.isNull() || !gInventory.isObjectDescendentOf(cat_id, marketplace_listings_uuid)) + // Not a descendent of the marketplace listings root and not part of marketplace -> likely called in error then... + if (marketplace_listings_uuid.isNull() || (!gInventory.isObjectDescendentOf(cat_id, marketplace_listings_uuid) && !LLMarketplaceData::instance().isListed(cat_id) && !LLMarketplaceData::instance().isVersionFolder(cat_id))) { // In those cases, just do the regular category update LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); @@ -169,6 +169,24 @@ void update_marketplace_category(const LLUUID& cat_id) S32 depth = depth_nesting_in_marketplace(cat_id); LLUUID listing_uuid = nested_parent_id(cat_id, depth); + // Verify marketplace data consistency for this listing + if (LLMarketplaceData::instance().isListed(listing_uuid)) + { + LLUUID version_folder_uuid = LLMarketplaceData::instance().getVersionFolderID(listing_uuid); + if (!gInventory.isObjectDescendentOf(version_folder_uuid, listing_uuid)) + { + // *TODO : Confirm with Producer that this is what we want to happen in that case! + llinfos << "Merov : Delisting as the version folder is not under the listing folder anymore!!" << llendl; + LLMarketplaceData::instance().deleteListing(listing_uuid); + } + if (!gInventory.isObjectDescendentOf(listing_uuid, marketplace_listings_uuid)) + { + // *TODO : Confirm with Producer that this is what we want to happen in that case! + llinfos << "Merov : Delisting as the listing folder is not under the marketplace folder anymore!!" << llendl; + LLMarketplaceData::instance().deleteListing(listing_uuid); + } + } + // Update all descendents starting from the listing root update_marketplace_folder_hierarchy(listing_uuid); |