diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 5143204185..a450c61ec8 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -380,7 +380,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_transactions.RemoveXferUploader(m_transactionID); - m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(ourClient.AgentId, (AssetType)type, m_asset.FullID, m_asset.Name, 0); + m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(item, 0); } /// diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 582b267ca4..e393d85441 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -209,7 +209,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } } - public void PostInventoryAsset(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel) + private void PostInventoryAsset(InventoryItemBase item, int userlevel) + { + InventoryFolderBase f = m_Scene.InventoryService.GetFolderForType(item.Owner, FolderType.Trash); + if (f == null || (f != null && item.Folder != f.ID)) + PostInventoryAsset(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel); + } + + private void PostInventoryAsset(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel) { if (type == AssetType.Link) return; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 5a9efb8a9b..ef595f32cf 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -518,7 +518,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } // This is a hook to do some per-asset post-processing for subclasses that need that - if (remoteClient != null) + if (remoteClient != null && action != DeRezAction.Delete) ExportAsset(remoteClient.AgentId, asset.FullID); return item; diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 97b9482550..7b2c12f3d7 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -745,7 +745,7 @@ namespace OpenSim.Region.Framework.Scenes public event OnIncomingSceneObjectDelegate OnIncomingSceneObject; public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); - public delegate void NewInventoryItemUploadComplete(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel); + public delegate void NewInventoryItemUploadComplete(InventoryItemBase item, int userlevel); public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete; @@ -2208,7 +2208,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, AssetType type, UUID AssetID, String AssetName, int userlevel) + public void TriggerOnNewInventoryItemUploadComplete(InventoryItemBase item, int userlevel) { NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; if (handlerNewInventoryItemUpdateComplete != null) @@ -2217,7 +2217,7 @@ namespace OpenSim.Region.Framework.Scenes { try { - d(agentID, type, AssetID, AssetName, userlevel); + d(item, userlevel); } catch (Exception e) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index b838177782..0a0cb55518 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -149,7 +149,7 @@ namespace OpenSim.Region.Framework.Scenes userlevel = 1; } if (trigger) - EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel); + EventManager.TriggerOnNewInventoryItemUploadComplete(item, userlevel); return true; } @@ -191,7 +191,7 @@ namespace OpenSim.Region.Framework.Scenes userlevel = 1; } if (trigger) - EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel); + EventManager.TriggerOnNewInventoryItemUploadComplete(item, userlevel); if (originalFolder != UUID.Zero) {