diff options
author | Diva Canto | 2009-08-22 10:24:26 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-22 10:24:26 -0700 |
commit | b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4 (patch) | |
tree | ac9eb8fc50943d35268cc56d67b1a3f38cf705b3 /OpenSim/Region | |
parent | Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4.zip opensim-SC_OLD-b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4.tar.gz opensim-SC_OLD-b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4.tar.bz2 opensim-SC_OLD-b03eeeb9f6331ed36c61f55aef847ce3b2db7ba4.tar.xz |
* Fixes mantis http://opensimulator.org/mantis/view.php?id=4044. Turns out folders were never being removed from trash when they were singled out for purging in trash. They were being removed when Trash was purged as a whole. That behavior is now fixed for the new InventoryService set.
* Removed left-overs from AssetInventoryServer.
Diffstat (limited to 'OpenSim/Region')
7 files changed, 59 insertions, 26 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index a7a5aa3..dd01780 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -7090,14 +7090,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7090 | if (OnRemoveInventoryFolder != null) | 7090 | if (OnRemoveInventoryFolder != null) |
7091 | { | 7091 | { |
7092 | handlerRemoveInventoryFolder = null; | 7092 | handlerRemoveInventoryFolder = null; |
7093 | List<UUID> uuids = new List<UUID>(); | ||
7093 | foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) | 7094 | foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) |
7094 | { | 7095 | { |
7095 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; | 7096 | uuids.Add(datablock.FolderID); |
7096 | 7097 | } | |
7097 | if (handlerRemoveInventoryFolder != null) | 7098 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; |
7098 | { | 7099 | if (handlerRemoveInventoryFolder != null) |
7099 | handlerRemoveInventoryFolder(this, datablock.FolderID); | 7100 | { |
7100 | } | 7101 | handlerRemoveInventoryFolder(this, uuids); |
7101 | } | 7102 | } |
7102 | } | 7103 | } |
7103 | break; | 7104 | break; |
@@ -7114,14 +7115,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7114 | if (OnRemoveInventoryFolder != null) | 7115 | if (OnRemoveInventoryFolder != null) |
7115 | { | 7116 | { |
7116 | handlerRemoveInventoryFolder = null; | 7117 | handlerRemoveInventoryFolder = null; |
7118 | List<UUID> uuids = new List<UUID>(); | ||
7117 | foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData) | 7119 | foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData) |
7118 | { | 7120 | { |
7119 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; | 7121 | uuids.Add(datablock.FolderID); |
7120 | 7122 | } | |
7121 | if (handlerRemoveInventoryFolder != null) | 7123 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; |
7122 | { | 7124 | if (handlerRemoveInventoryFolder != null) |
7123 | handlerRemoveInventoryFolder(this, datablock.FolderID); | 7125 | { |
7124 | } | 7126 | handlerRemoveInventoryFolder(this, uuids); |
7125 | } | 7127 | } |
7126 | } | 7128 | } |
7127 | 7129 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index d4cb616..bd32f3b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -139,6 +139,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
139 | public abstract bool MoveFolder(InventoryFolderBase folder); | 139 | public abstract bool MoveFolder(InventoryFolderBase folder); |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Delete a list of inventory folders (from trash) | ||
143 | /// </summary> | ||
144 | public abstract bool DeleteFolders(UUID ownerID, List<UUID> folderIDs); | ||
145 | |||
146 | /// <summary> | ||
142 | /// Purge an inventory folder of all its items and subfolders. | 147 | /// Purge an inventory folder of all its items and subfolders. |
143 | /// </summary> | 148 | /// </summary> |
144 | /// <param name="folder"></param> | 149 | /// <param name="folder"></param> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 787c6c8..1c66254 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -330,6 +330,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
330 | } | 330 | } |
331 | } | 331 | } |
332 | 332 | ||
333 | public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
334 | { | ||
335 | if (folderIDs == null) | ||
336 | return false; | ||
337 | if (folderIDs.Count == 0) | ||
338 | return false; | ||
339 | |||
340 | if (IsLocalGridUser(ownerID)) | ||
341 | return m_GridService.DeleteFolders(ownerID, folderIDs); | ||
342 | else | ||
343 | { | ||
344 | UUID sessionID = GetSessionID(ownerID); | ||
345 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); | ||
346 | return m_HGService.DeleteFolders(uri, folderIDs, sessionID); | ||
347 | } | ||
348 | } | ||
349 | |||
333 | public override bool MoveFolder(InventoryFolderBase folder) | 350 | public override bool MoveFolder(InventoryFolderBase folder) |
334 | { | 351 | { |
335 | if (folder == null) | 352 | if (folder == null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index e6edcf2..66d11dd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -258,6 +258,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
258 | return m_InventoryService.MoveFolder(folder); | 258 | return m_InventoryService.MoveFolder(folder); |
259 | } | 259 | } |
260 | 260 | ||
261 | public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
262 | { | ||
263 | return m_InventoryService.DeleteFolders(ownerID, folderIDs); | ||
264 | } | ||
265 | |||
261 | /// <summary> | 266 | /// <summary> |
262 | /// Purge an inventory folder of all its items and subfolders. | 267 | /// Purge an inventory folder of all its items and subfolders. |
263 | /// </summary> | 268 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 201442c..0d32c77 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -243,6 +243,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
243 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); | 243 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); |
244 | } | 244 | } |
245 | 245 | ||
246 | public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
247 | { | ||
248 | if (folderIDs == null) | ||
249 | return false; | ||
250 | if (folderIDs.Count == 0) | ||
251 | return false; | ||
252 | |||
253 | UUID sessionID = GetSessionID(ownerID); | ||
254 | return m_RemoteConnector.DeleteFolders(ownerID.ToString(), folderIDs, sessionID); | ||
255 | } | ||
256 | |||
257 | |||
246 | public override bool PurgeFolder(InventoryFolderBase folder) | 258 | public override bool PurgeFolder(InventoryFolderBase folder) |
247 | { | 259 | { |
248 | if (folder == null) | 260 | if (folder == null) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index a9d361b..3301536 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -789,23 +789,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
789 | } | 789 | } |
790 | 790 | ||
791 | /// <summary> | 791 | /// <summary> |
792 | /// Removes an inventory folder. Although there is a packet in the Linden protocol for this, it may be | 792 | /// Removes an inventory folder. This packet is sent when the user |
793 | /// legacy and not currently used (purge folder is used to remove folders from trash instead). | 793 | /// right-clicks a folder that's already in trash and chooses "purge" |
794 | /// </summary> | 794 | /// </summary> |
795 | /// <param name="remoteClient"></param> | 795 | /// <param name="remoteClient"></param> |
796 | /// <param name="folderID"></param> | 796 | /// <param name="folderID"></param> |
797 | private void RemoveInventoryFolder(IClientAPI remoteClient, UUID folderID) | 797 | private void RemoveInventoryFolder(IClientAPI remoteClient, List<UUID> folderIDs) |
798 | { | 798 | { |
799 | // Unclear is this handler is ever called by the Linden client, but it might | 799 | m_log.DebugFormat("[SCENE INVENTORY]: RemoveInventoryFolders count {0}", folderIDs.Count); |
800 | 800 | InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs); | |
801 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | ||
802 | folder.Owner = remoteClient.AgentId; | ||
803 | InventoryFolderBase trash = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder); | ||
804 | if (trash != null) | ||
805 | { | ||
806 | folder.ParentID = trash.ID; | ||
807 | InventoryService.MoveFolder(folder); | ||
808 | } | ||
809 | } | 801 | } |
810 | 802 | ||
811 | private SceneObjectGroup GetGroupByPrim(uint localID) | 803 | private SceneObjectGroup GetGroupByPrim(uint localID) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 2b815a2..d3e414f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -552,7 +552,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
552 | 552 | ||
553 | public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) | 553 | public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) |
554 | { | 554 | { |
555 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | 555 | InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); |
556 | folder = InventoryService.GetFolder(folder); | 556 | folder = InventoryService.GetFolder(folder); |
557 | if (folder != null) | 557 | if (folder != null) |
558 | { | 558 | { |