diff options
author | Diva Canto | 2009-08-19 10:56:08 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-19 10:56:08 -0700 |
commit | d519f1885f587409592cf92bc0f4ba8533a1866f (patch) | |
tree | dc8d0073d09050c8787121290b1e3a8f65119812 | |
parent | Async purge so that the client thread doesn't wait. (diff) | |
download | opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.zip opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.gz opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.bz2 opensim-SC-d519f1885f587409592cf92bc0f4ba8533a1866f.tar.xz |
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).
16 files changed, 162 insertions, 38 deletions
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index d5d4d1e..6f86704 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs | |||
@@ -547,6 +547,11 @@ namespace OpenSim.Framework.Communications.Tests | |||
547 | return false; | 547 | return false; |
548 | } | 548 | } |
549 | 549 | ||
550 | public bool MoveItems(UUID owner, List<InventoryItemBase> items) | ||
551 | { | ||
552 | return false; | ||
553 | } | ||
554 | |||
550 | public bool DeleteItems(UUID owner, List<UUID> items) | 555 | public bool DeleteItems(UUID owner, List<UUID> items) |
551 | { | 556 | { |
552 | return false; | 557 | return false; |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index ca37a5b..c6cdcaa 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -254,7 +254,7 @@ namespace OpenSim.Framework | |||
254 | string newName); | 254 | string newName); |
255 | 255 | ||
256 | public delegate void MoveInventoryItem( | 256 | public delegate void MoveInventoryItem( |
257 | IClientAPI remoteClient, UUID folderID, UUID itemID, int length, string newName); | 257 | IClientAPI remoteClient, List<InventoryItemBase> items); |
258 | 258 | ||
259 | public delegate void RemoveInventoryItem( | 259 | public delegate void RemoveInventoryItem( |
260 | IClientAPI remoteClient, List<UUID> itemIDs); | 260 | IClientAPI remoteClient, List<UUID> itemIDs); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e2fb659..6969a3d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -7027,14 +7027,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7027 | if (OnMoveInventoryItem != null) | 7027 | if (OnMoveInventoryItem != null) |
7028 | { | 7028 | { |
7029 | handlerMoveInventoryItem = null; | 7029 | handlerMoveInventoryItem = null; |
7030 | InventoryItemBase itm = null; | ||
7031 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
7030 | foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) | 7032 | foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) |
7031 | { | 7033 | { |
7032 | handlerMoveInventoryItem = OnMoveInventoryItem; | 7034 | itm = new InventoryItemBase(datablock.ItemID, AgentId); |
7033 | if (handlerMoveInventoryItem != null) | 7035 | itm.Folder = datablock.FolderID; |
7034 | { | 7036 | itm.Name = Util.FieldToString(datablock.NewName); |
7035 | handlerMoveInventoryItem(this, datablock.FolderID, datablock.ItemID, datablock.Length, | 7037 | // weird, comes out as empty string |
7036 | Util.FieldToString(datablock.NewName)); | 7038 | //m_log.DebugFormat("[XXX] new name: {0}", itm.Name); |
7037 | } | 7039 | items.Add(itm); |
7040 | } | ||
7041 | handlerMoveInventoryItem = OnMoveInventoryItem; | ||
7042 | if (handlerMoveInventoryItem != null) | ||
7043 | { | ||
7044 | handlerMoveInventoryItem(this, items); | ||
7038 | } | 7045 | } |
7039 | } | 7046 | } |
7040 | break; | 7047 | break; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index d1ae3e4..d4cb616 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -181,6 +181,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
181 | /// <returns>true if the item was successfully updated</returns> | 181 | /// <returns>true if the item was successfully updated</returns> |
182 | public abstract bool UpdateItem(InventoryItemBase item); | 182 | public abstract bool UpdateItem(InventoryItemBase item); |
183 | 183 | ||
184 | public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items); | ||
185 | |||
184 | /// <summary> | 186 | /// <summary> |
185 | /// Delete an item from the user's inventory | 187 | /// Delete an item from the user's inventory |
186 | /// </summary> | 188 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 6a1f2d5..787c6c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -393,6 +393,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
393 | } | 393 | } |
394 | } | 394 | } |
395 | 395 | ||
396 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
397 | { | ||
398 | if (items == null) | ||
399 | return false; | ||
400 | if (items.Count == 0) | ||
401 | return true; | ||
402 | |||
403 | if (IsLocalGridUser(ownerID)) | ||
404 | return m_GridService.MoveItems(ownerID, items); | ||
405 | else | ||
406 | { | ||
407 | UUID sessionID = GetSessionID(ownerID); | ||
408 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); | ||
409 | return m_HGService.MoveItems(uri, items, sessionID); | ||
410 | } | ||
411 | } | ||
412 | |||
396 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | 413 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
397 | { | 414 | { |
398 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); | 415 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index b2640af..562c5dd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -289,6 +289,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
289 | return m_InventoryService.UpdateItem(item); | 289 | return m_InventoryService.UpdateItem(item); |
290 | } | 290 | } |
291 | 291 | ||
292 | |||
293 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
294 | { | ||
295 | return m_InventoryService.MoveItems(ownerID, items); | ||
296 | } | ||
297 | |||
292 | /// <summary> | 298 | /// <summary> |
293 | /// Delete an item from the user's inventory | 299 | /// Delete an item from the user's inventory |
294 | /// </summary> | 300 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 081d0f7..201442c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -273,6 +273,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
273 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); | 273 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); |
274 | } | 274 | } |
275 | 275 | ||
276 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
277 | { | ||
278 | if (items == null) | ||
279 | return false; | ||
280 | |||
281 | UUID sessionID = GetSessionID(ownerID); | ||
282 | return m_RemoteConnector.MoveItems(ownerID.ToString(), items, sessionID); | ||
283 | } | ||
284 | |||
285 | |||
276 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | 286 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
277 | { | 287 | { |
278 | if (itemIDs == null) | 288 | if (itemIDs == null) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 5e2eb73..a119efc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -638,36 +638,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
638 | /// <param name="itemID"></param> | 638 | /// <param name="itemID"></param> |
639 | /// <param name="length"></param> | 639 | /// <param name="length"></param> |
640 | /// <param name="newName"></param> | 640 | /// <param name="newName"></param> |
641 | public void MoveInventoryItem(IClientAPI remoteClient, UUID folderID, UUID itemID, int length, | 641 | public void MoveInventoryItem(IClientAPI remoteClient, List<InventoryItemBase> items) |
642 | string newName) | ||
643 | { | 642 | { |
644 | m_log.DebugFormat( | 643 | m_log.DebugFormat( |
645 | "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); | 644 | "[AGENT INVENTORY]: Moving {0} items for user {1}", items.Count, remoteClient.AgentId); |
646 | 645 | ||
647 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 646 | if (!InventoryService.MoveItems(remoteClient.AgentId, items)) |
648 | item = InventoryService.GetItem(item); | 647 | m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + remoteClient.AgentId); |
649 | |||
650 | if (item != null) | ||
651 | { | ||
652 | if (newName != String.Empty) | ||
653 | { | ||
654 | item.Name = newName; | ||
655 | } | ||
656 | item.Folder = folderID; | ||
657 | |||
658 | // Diva comment: can't we just update? | ||
659 | List<UUID> uuids = new List<UUID>(); | ||
660 | uuids.Add(item.ID); | ||
661 | InventoryService.DeleteItems(item.Owner, uuids); | ||
662 | |||
663 | AddInventoryItem(remoteClient, item); | ||
664 | } | ||
665 | else | ||
666 | { | ||
667 | m_log.Warn("[AGENT INVENTORY]: Failed to find item " + itemID.ToString()); | ||
668 | |||
669 | return; | ||
670 | } | ||
671 | } | 648 | } |
672 | 649 | ||
673 | /// <summary> | 650 | /// <summary> |
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 | |||
125 | "POST", "/NewFolder/", m_InventoryService.AddFolder, CheckAuthSession)); | 125 | "POST", "/NewFolder/", m_InventoryService.AddFolder, CheckAuthSession)); |
126 | 126 | ||
127 | m_httpServer.AddStreamHandler( | 127 | m_httpServer.AddStreamHandler( |
128 | new RestDeserialiseTrustedHandler<InventoryFolderBase, bool>( | 128 | new RestDeserialiseSecureHandler<InventoryFolderBase, bool>( |
129 | "POST", "/CreateFolder/", m_InventoryService.AddFolder, CheckTrustSource)); | 129 | "POST", "/CreateFolder/", m_InventoryService.AddFolder, CheckAuthSession)); |
130 | 130 | ||
131 | m_httpServer.AddStreamHandler( | 131 | m_httpServer.AddStreamHandler( |
132 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( | 132 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( |
@@ -137,9 +137,13 @@ namespace OpenSim.Server.Handlers.Inventory | |||
137 | "POST", "/AddNewItem/", m_InventoryService.AddItem, CheckTrustSource)); | 137 | "POST", "/AddNewItem/", m_InventoryService.AddItem, CheckTrustSource)); |
138 | 138 | ||
139 | m_httpServer.AddStreamHandler( | 139 | m_httpServer.AddStreamHandler( |
140 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>( | 140 | new RestDeserialiseSecureHandler<Guid, List<InventoryItemBase>>( |
141 | "POST", "/GetItems/", GetFolderItems, CheckTrustSource)); | 141 | "POST", "/GetItems/", GetFolderItems, CheckAuthSession)); |
142 | 142 | ||
143 | m_httpServer.AddStreamHandler( | ||
144 | new RestDeserialiseSecureHandler<List<InventoryItemBase>, bool>( | ||
145 | "POST", "/MoveItems/", MoveItems, CheckAuthSession)); | ||
146 | |||
143 | // for persistent active gestures | 147 | // for persistent active gestures |
144 | m_httpServer.AddStreamHandler( | 148 | m_httpServer.AddStreamHandler( |
145 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>> | 149 | new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>> |
@@ -256,6 +260,15 @@ namespace OpenSim.Server.Handlers.Inventory | |||
256 | return m_InventoryService.DeleteItems(UUID.Zero, uuids); | 260 | return m_InventoryService.DeleteItems(UUID.Zero, uuids); |
257 | } | 261 | } |
258 | 262 | ||
263 | public bool MoveItems(List<InventoryItemBase> items) | ||
264 | { | ||
265 | // oops we lost the user info here. Bad bad handlers | ||
266 | // let's peek at one item | ||
267 | UUID ownerID = UUID.Zero; | ||
268 | if (items.Count > 0) | ||
269 | ownerID = items[0].Owner; | ||
270 | return m_InventoryService.MoveItems(ownerID, items); | ||
271 | } | ||
259 | #endregion | 272 | #endregion |
260 | 273 | ||
261 | /// <summary> | 274 | /// <summary> |
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs index 00b74b5..45e921a 100644 --- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs | |||
@@ -253,6 +253,19 @@ namespace OpenSim.Services.Connectors.Inventory | |||
253 | return false; | 253 | return false; |
254 | } | 254 | } |
255 | 255 | ||
256 | public bool MoveItems(string id, List<InventoryItemBase> items, UUID sessionID) | ||
257 | { | ||
258 | string url = string.Empty; | ||
259 | string userID = string.Empty; | ||
260 | |||
261 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
262 | { | ||
263 | ISessionAuthInventoryService connector = GetConnector(url); | ||
264 | return connector.MoveItems(userID, items, sessionID); | ||
265 | } | ||
266 | return false; | ||
267 | } | ||
268 | |||
256 | public bool DeleteItems(string id, List<UUID> itemIDs, UUID sessionID) | 269 | public bool DeleteItems(string id, List<UUID> itemIDs, UUID sessionID) |
257 | { | 270 | { |
258 | string url = string.Empty; | 271 | string url = string.Empty; |
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs index e4e713c..c89c9b7 100644 --- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs +++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs | |||
@@ -116,6 +116,8 @@ namespace OpenSim.Services.Connectors | |||
116 | /// <returns>true if the item was successfully updated</returns> | 116 | /// <returns>true if the item was successfully updated</returns> |
117 | bool UpdateItem(string userID, InventoryItemBase item, UUID session_id); | 117 | bool UpdateItem(string userID, InventoryItemBase item, UUID session_id); |
118 | 118 | ||
119 | bool MoveItems(string userID, List<InventoryItemBase> items, UUID session_id); | ||
120 | |||
119 | /// <summary> | 121 | /// <summary> |
120 | /// Delete an item from the user's inventory | 122 | /// Delete an item from the user's inventory |
121 | /// </summary> | 123 | /// </summary> |
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index 9b2e331..bcf9d87 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -383,6 +383,48 @@ namespace OpenSim.Services.Connectors | |||
383 | return false; | 383 | return false; |
384 | } | 384 | } |
385 | 385 | ||
386 | /** | ||
387 | * MoveItems Async group | ||
388 | */ | ||
389 | |||
390 | delegate void MoveItemsDelegate(string userID, List<InventoryItemBase> items, UUID sessionID); | ||
391 | |||
392 | private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID) | ||
393 | { | ||
394 | try | ||
395 | { | ||
396 | SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject( | ||
397 | "POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString()); | ||
398 | |||
399 | // Success | ||
400 | return; | ||
401 | } | ||
402 | catch (Exception e) | ||
403 | { | ||
404 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: Move inventory items operation failed, {0} {1} (old server?). Trying slow way.", | ||
405 | e.Source, e.Message); | ||
406 | } | ||
407 | |||
408 | foreach (InventoryItemBase item in items) | ||
409 | { | ||
410 | InventoryItemBase itm = this.QueryItem(userID, item, sessionID); | ||
411 | itm.Name = item.Name; | ||
412 | itm.Folder = item.Folder; | ||
413 | this.UpdateItem(userID, itm, sessionID); | ||
414 | } | ||
415 | } | ||
416 | |||
417 | private void MoveItemsCompleted(IAsyncResult iar) | ||
418 | { | ||
419 | } | ||
420 | |||
421 | public bool MoveItems(string userID, List<InventoryItemBase> items, UUID sessionID) | ||
422 | { | ||
423 | MoveItemsDelegate d = MoveItemsAsync; | ||
424 | d.BeginInvoke(userID, items, sessionID, MoveItemsCompleted, d); | ||
425 | return true; | ||
426 | } | ||
427 | |||
386 | public bool DeleteItems(string userID, List<UUID> items, UUID sessionID) | 428 | public bool DeleteItems(string userID, List<UUID> items, UUID sessionID) |
387 | { | 429 | { |
388 | try | 430 | try |
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs index 3bbf129..cd283ff 100644 --- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs | |||
@@ -151,6 +151,11 @@ namespace OpenSim.Services.Connectors | |||
151 | return false; | 151 | return false; |
152 | } | 152 | } |
153 | 153 | ||
154 | public bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
155 | { | ||
156 | return false; | ||
157 | } | ||
158 | |||
154 | public bool DeleteItems(UUID owner, List<UUID> itemIDs) | 159 | public bool DeleteItems(UUID owner, List<UUID> itemIDs) |
155 | { | 160 | { |
156 | return false; | 161 | return false; |
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index 6409b57..ebdb09a 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs | |||
@@ -142,6 +142,8 @@ namespace OpenSim.Services.Interfaces | |||
142 | /// <returns>true if the item was successfully updated</returns> | 142 | /// <returns>true if the item was successfully updated</returns> |
143 | bool UpdateItem(InventoryItemBase item); | 143 | bool UpdateItem(InventoryItemBase item); |
144 | 144 | ||
145 | bool MoveItems(UUID ownerID, List<InventoryItemBase> items); | ||
146 | |||
145 | /// <summary> | 147 | /// <summary> |
146 | /// Delete an item from the user's inventory | 148 | /// Delete an item from the user's inventory |
147 | /// </summary> | 149 | /// </summary> |
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 69b1b28..e0217f6 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -386,6 +386,24 @@ namespace OpenSim.Services.InventoryService | |||
386 | return true; | 386 | return true; |
387 | } | 387 | } |
388 | 388 | ||
389 | public virtual bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
390 | { | ||
391 | m_log.InfoFormat( | ||
392 | "[INVENTORY SERVICE]: Moving {0} items from user {1}", items.Count, ownerID); | ||
393 | |||
394 | InventoryItemBase itm = null; | ||
395 | foreach (InventoryItemBase item in items) | ||
396 | { | ||
397 | itm = GetInventoryItem(item.ID); | ||
398 | itm.Folder = item.Folder; | ||
399 | if ((item.Name != null) && !item.Name.Equals(string.Empty)) | ||
400 | itm.Name = item.Name; | ||
401 | m_Database.updateInventoryItem(itm); | ||
402 | } | ||
403 | |||
404 | return true; | ||
405 | } | ||
406 | |||
389 | // See IInventoryServices | 407 | // See IInventoryServices |
390 | public virtual bool DeleteItems(UUID owner, List<UUID> itemIDs) | 408 | public virtual bool DeleteItems(UUID owner, List<UUID> itemIDs) |
391 | { | 409 | { |
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index f770f75..ee22e5e 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs | |||
@@ -143,6 +143,11 @@ namespace OpenSim.Tests.Common.Mock | |||
143 | return false; | 143 | return false; |
144 | } | 144 | } |
145 | 145 | ||
146 | public bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
147 | { | ||
148 | return false; | ||
149 | } | ||
150 | |||
146 | public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | 151 | public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
147 | { | 152 | { |
148 | return false; | 153 | return false; |