From 4deb9f54c64d114bfd2aba76e51eaa01908b6610 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Tue, 29 Apr 2014 12:03:03 -0700
Subject: [PATCH] DD-76 : Do not allow Calling Cards in Marketplace Listings

---
 indra/newview/llinventorybridge.cpp    |  3 +++
 indra/newview/llinventoryfunctions.cpp | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index e6ecd4e96e8..97646dc949e 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4408,7 +4408,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		}
         else if (move_is_into_marketplacelistings)
         {
+            // Check stock folder type matches item type
             accept = (getCategory() && getCategory()->acceptItem(inv_item));
+            // Do not accept calling cards in marketplace listings
+            accept &= (LLAssetType::AT_CALLINGCARD != inv_item->getType());
         }
 
 		LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 10a5ac4bc71..e63aca67f88 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1129,6 +1129,16 @@ void validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
             }
             continue;
         }
+        if (viewer_inv_item->getType() == LLAssetType::AT_CALLINGCARD)
+        {
+            std::string message = "    Error : calling cards are not allowed in listings : " + viewer_inv_item->getName();
+            llinfos << "Merov : Validation error : " << message << llendl;
+            if (cb)
+            {
+                cb(message);
+            }
+            continue;
+        }
         // Update the appropriate vector item for that type
         LLInventoryType::EType type = LLInventoryType::IT_COUNT;    // Default value for non stock items
         if (!viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
-- 
GitLab