From d519f1885f587409592cf92bc0f4ba8533a1866f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 19 Aug 2009 10:56:08 -0700 Subject: Added MoveItems, which is most useful upon viewer-delete inventory operation. Moving a batch of items is a 1-time operation. Made it async anyway, so that the viewer doesn't wait in case the DB layer is dumb (which is the case currently). --- .../Inventory/InventoryServerInConnector.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'OpenSim/Server/Handlers') diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 6cfc7df..6ef1d9d 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs @@ -125,8 +125,8 @@ namespace OpenSim.Server.Handlers.Inventory "POST", "/NewFolder/", m_InventoryService.AddFolder, CheckAuthSession)); m_httpServer.AddStreamHandler( - new RestDeserialiseTrustedHandler( - "POST", "/CreateFolder/", m_InventoryService.AddFolder, CheckTrustSource)); + new RestDeserialiseSecureHandler( + "POST", "/CreateFolder/", m_InventoryService.AddFolder, CheckAuthSession)); m_httpServer.AddStreamHandler( new RestDeserialiseSecureHandler( @@ -137,9 +137,13 @@ namespace OpenSim.Server.Handlers.Inventory "POST", "/AddNewItem/", m_InventoryService.AddItem, CheckTrustSource)); m_httpServer.AddStreamHandler( - new RestDeserialiseTrustedHandler>( - "POST", "/GetItems/", GetFolderItems, CheckTrustSource)); + new RestDeserialiseSecureHandler>( + "POST", "/GetItems/", GetFolderItems, CheckAuthSession)); + m_httpServer.AddStreamHandler( + new RestDeserialiseSecureHandler, bool>( + "POST", "/MoveItems/", MoveItems, CheckAuthSession)); + // for persistent active gestures m_httpServer.AddStreamHandler( new RestDeserialiseTrustedHandler> @@ -256,6 +260,15 @@ namespace OpenSim.Server.Handlers.Inventory return m_InventoryService.DeleteItems(UUID.Zero, uuids); } + public bool MoveItems(List items) + { + // oops we lost the user info here. Bad bad handlers + // let's peek at one item + UUID ownerID = UUID.Zero; + if (items.Count > 0) + ownerID = items[0].Owner; + return m_InventoryService.MoveItems(ownerID, items); + } #endregion /// -- cgit v1.1