From edee11ff8750d452f012690c556384984795f4be Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 14 Nov 2008 17:24:56 +0000
Subject: Reapplying a revised version of Christopher Yeoh's (IBM) patch for
allow inventory drop. Also adds a new flags, "propagate_permissions" to
OpenSim.ini to control that feature.
---
.../Environment/Scenes/SceneObjectPart.Inventory.cs | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs')
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 501f199..073bccf 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -289,16 +289,16 @@ namespace OpenSim.Region.Environment.Scenes
/// name is chosen.
///
///
- public void AddInventoryItem(TaskInventoryItem item)
+ public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop)
{
- AddInventoryItem(item.Name, item);
+ AddInventoryItem(item.Name, item, allowedDrop);
}
///
/// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced.
///
///
- public void AddInventoryItemExclusive(TaskInventoryItem item)
+ public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
{
List il = new List(m_taskInventory.Values);
foreach (TaskInventoryItem i in il)
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- AddInventoryItem(item.Name, item);
+ AddInventoryItem(item.Name, item, allowedDrop);
}
///
@@ -324,7 +324,10 @@ namespace OpenSim.Region.Environment.Scenes
/// The item itself. The name within this structure is ignored in favour of the name
/// given in this method's arguments
///
- protected void AddInventoryItem(string name, TaskInventoryItem item)
+ ///
+ /// Item was only added to inventory because AllowedDrop is set
+ ///
+ protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
{
name = FindAvailableInventoryName(name);
if (name == String.Empty)
@@ -337,7 +340,11 @@ namespace OpenSim.Region.Environment.Scenes
lock (m_taskInventory)
{
m_taskInventory.Add(item.ItemID, item);
- TriggerScriptChangedEvent(Changed.INVENTORY);
+
+ if (allowedDrop)
+ TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
+ else
+ TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_inventorySerial++;
--
cgit v1.1