summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-08-11 12:18:47 -0700
committerRider Linden <rider@lindenlab.com>2015-08-11 12:18:47 -0700
commit9df2e7e4cb11a3ca7fabc2a3c443564da18b9a13 (patch)
tree29f0229aa5ad443ed36d56a2dca0102fd83c1447 /indra/newview/llviewerinventory.cpp
parent5a0025026cee93eb657290544b95eb00557ae5f1 (diff)
parent310ec101dfd2c69ecc1a51d0a3a8ea12d5fdaf7a (diff)
Merge
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rwxr-xr-xindra/newview/llviewerinventory.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 81ea91a661..729af3c8ed 100755
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -817,6 +817,36 @@ bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const
return true;
}
+bool LLViewerInventoryCategory::acceptItem(LLInventoryItem* inv_item)
+{
+ if (!inv_item)
+ {
+ return false;
+ }
+
+ // Only stock folders have limitation on which item they will accept
+ bool accept = true;
+ if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK)
+ {
+ // If the item is copyable (i.e. non stock) do not accept the drop in a stock folder
+ if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
+ {
+ accept = false;
+ }
+ else
+ {
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(getUUID(),cat_array,item_array);
+ // Destination stock folder must be empty OR types of incoming and existing items must be identical and have the same permissions
+ accept = (!item_array->size() ||
+ ((item_array->at(0)->getInventoryType() == inv_item->getInventoryType()) &&
+ (item_array->at(0)->getPermissions().getMaskNextOwner() == inv_item->getPermissions().getMaskNextOwner())));
+ }
+ }
+ return accept;
+}
+
void LLViewerInventoryCategory::determineFolderType()
{
/* Do NOT uncomment this code. This is for future 2.1 support of ensembles.