From a390541e1c114db419d9a2eb1ac576a582c35e67 Mon Sep 17 00:00:00 2001 From: sacha Date: Fri, 6 Aug 2010 14:38:11 +0000 Subject: Allowing the expected purge trash folder... Please validate !!! --- OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 1 + OpenSim/Services/InventoryService/XInventoryService.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index ac6a3ab..e3d30e5 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs @@ -408,6 +408,7 @@ namespace OpenSim.Server.Handlers.Asset byte[] HandlePurgeFolder(Dictionary request) { + Dictionary result = new Dictionary(); UUID folderID = UUID.Zero; UUID.TryParse(request["ID"].ToString(), out folderID); diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index f581f76..fc5020d 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -329,8 +329,8 @@ namespace OpenSim.Services.InventoryService if (!m_AllowDelete) return false; - if (!ParentIsTrash(folder.ID)) - return false; +// if (!ParentIsTrash(folder.ID)) +// return false; XInventoryFolder[] subFolders = m_Database.GetFolders( new string[] { "parentFolderID" }, @@ -342,6 +342,7 @@ namespace OpenSim.Services.InventoryService m_Database.DeleteFolders("folderID", x.folderID.ToString()); } + if (!ParentIsTrash(folder.ID)) m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); return true; -- cgit v1.1 From 5da272d0425cc6a971b60a1e5fad556d4d66eb52 Mon Sep 17 00:00:00 2001 From: sacha Date: Fri, 6 Aug 2010 14:45:54 +0000 Subject: reverese my last commit --- OpenSim/Services/InventoryService/XInventoryService.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index fc5020d..541489f 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -329,8 +329,8 @@ namespace OpenSim.Services.InventoryService if (!m_AllowDelete) return false; -// if (!ParentIsTrash(folder.ID)) -// return false; + if (!ParentIsTrash(folder.ID)) + return false; XInventoryFolder[] subFolders = m_Database.GetFolders( new string[] { "parentFolderID" }, @@ -342,8 +342,6 @@ namespace OpenSim.Services.InventoryService m_Database.DeleteFolders("folderID", x.folderID.ToString()); } - if (!ParentIsTrash(folder.ID)) - m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); return true; } -- cgit v1.1 From 42613ec53602093335ebe3ce5127d797318bdf23 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Aug 2010 15:18:48 +0200 Subject: Allow the trash folder itself to be passed to PurgeFolder --- OpenSim/Services/InventoryService/XInventoryService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 541489f..26c5b33 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -541,6 +541,9 @@ namespace OpenSim.Services.InventoryService if (folder.Length < 1) return false; + if (folder[0].type == (int)AssetType.TrashFolder) + return true; + UUID parentFolder = folder[0].parentFolderID; while (parentFolder != UUID.Zero) -- cgit v1.1 From 696c2c429b3240d775053444943dcfc69c1b814a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Aug 2010 15:33:22 +0200 Subject: Change XEngine to use the new constant --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index dcbe0c4..b4da246 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -388,7 +388,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance PostEvent(new EventParams("attach", new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); } - else if (m_stateSource == StateSource.NewRez) + else if (m_stateSource == StateSource.RegionStart) { // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); PostEvent(new EventParams("changed", -- cgit v1.1