summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-30 21:39:43 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-30 21:40:19 +0300
commitae3e3662159ca26db5b2efe36d91a9ccdfcec256 (patch)
treeb6b1198f8da894a5795b640854ce587648d6a4ef /indra/newview/llinventoryfunctions.cpp
parentc15ee792a7248cf141abb3ae6a26b33a5aca1ed7 (diff)
SL-19379 WIP update gear menu with Gallery items
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index f24c2de714..7979ef209a 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -55,6 +55,7 @@
#include "llfocusmgr.h"
#include "llfolderview.h"
#include "llgesturemgr.h"
+#include "llgiveinventory.h"
#include "lliconctrl.h"
#include "llimview.h"
#include "llinventorybridge.h"
@@ -2219,6 +2220,35 @@ std::string get_searchable_UUID(LLInventoryModel* model, const LLUUID& item_id)
}
return LLStringUtil::null;
}
+
+bool can_share_item(const LLUUID& item_id)
+{
+ bool can_share = false;
+
+ if (gInventory.isObjectDescendentOf(item_id, gInventory.getRootFolderID()))
+ {
+ const LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ if (item)
+ {
+ if (LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item))
+ {
+ can_share = LLGiveInventory::isInventoryGiveAcceptable(item);
+ }
+ }
+ else
+ {
+ can_share = (gInventory.getCategory(item_id) != NULL);
+ }
+
+ const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
+ if ((item_id == trash_id) || gInventory.isObjectDescendentOf(item_id, trash_id))
+ {
+ can_share = false;
+ }
+ }
+
+ return can_share;
+}
///----------------------------------------------------------------------------
/// LLMarketplaceValidator implementations
///----------------------------------------------------------------------------