summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index c05eea7bd8..9aa7f54fa9 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -56,6 +56,7 @@
#include "llcallbacklist.h"
#include "llpreview.h"
#include "llviewercontrol.h"
+#include "llvoavatar.h"
#include "llsdutil.h"
#include <deque>
@@ -3064,6 +3065,45 @@ void LLInventoryModel::dumpInventory()
/// LLInventoryCollectFunctor implementations
///----------------------------------------------------------------------------
+// static
+bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* item)
+{
+ if (!item)
+ return false;
+
+ bool allowed = false;
+ LLVOAvatar* my_avatar = NULL;
+
+ switch(item->getType())
+ {
+ case LLAssetType::AT_CALLINGCARD:
+ // not allowed
+ break;
+
+ case LLAssetType::AT_OBJECT:
+ my_avatar = gAgent.getAvatarObject();
+ if(my_avatar && !my_avatar->isWearingAttachment(item->getUUID()))
+ {
+ allowed = true;
+ }
+ break;
+
+ case LLAssetType::AT_BODYPART:
+ case LLAssetType::AT_CLOTHING:
+ if(!gAgent.isWearingItem(item->getUUID()))
+ {
+ allowed = true;
+ }
+ break;
+
+ default:
+ allowed = true;
+ break;
+ }
+
+ return allowed;
+}
+
bool LLIsType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
{
if(mType == LLAssetType::AT_CATEGORY)