diff options
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.cpp | 11 | ||||
-rwxr-xr-x | indra/newview/llmarketplacefunctions.cpp | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index cd76cabfbd..c1664631f0 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -636,6 +636,15 @@ void LLFloaterMarketplaceListings::onChanged() // LLFloaterAssociateListing //----------------------------------------------------------------------------- +// Tell if a listing has one only version folder +bool hasUniqueVersionFolder(const LLUUID& folder_id) +{ + LLInventoryModel::cat_array_t* categories; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(folder_id, categories, items); + return (categories->size() == 1); +} + LLFloaterAssociateListing::LLFloaterAssociateListing(const LLSD& key) : LLFloater(key) , mUUID() @@ -703,7 +712,7 @@ void LLFloaterAssociateListing::apply(BOOL user_confirm) // Check if the id exists in the merchant SLM DB: note that this record might exist in the LLMarketplaceData // structure even if unseen in the UI, for instance, if its listing_uuid doesn't exist in the merchant inventory LLUUID listing_uuid = LLMarketplaceData::instance().getListingFolder(id); - if (listing_uuid.notNull() && user_confirm && LLMarketplaceData::instance().getActivationState(listing_uuid)) + if (listing_uuid.notNull() && user_confirm && LLMarketplaceData::instance().getActivationState(listing_uuid) && !hasUniqueVersionFolder(mUUID)) { // Look for user confirmation before unlisting LLNotificationsUtil::add("ConfirmMerchantUnlist", LLSD(), LLSD(), boost::bind(&LLFloaterAssociateListing::callback_apply, this, _1, _2)); diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 0315785960..3bedb0db44 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -1348,7 +1348,6 @@ void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing // Note : we're assuming that sending unchanged info won't break anything server side... root["listing"]["id"] = listing_id; - root["listing"]["is_listed"] = false; root["listing"]["inventory_info"]["listing_folder_id"] = folder_id.asString(); root["listing"]["inventory_info"]["version_folder_id"] = version_id.asString(); root["listing"]["inventory_info"]["count_on_hand"] = -1; |