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). --- OpenSim/Services/InventoryService/InventoryService.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Services/InventoryService') 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 return true; } + public virtual bool MoveItems(UUID ownerID, List items) + { + m_log.InfoFormat( + "[INVENTORY SERVICE]: Moving {0} items from user {1}", items.Count, ownerID); + + InventoryItemBase itm = null; + foreach (InventoryItemBase item in items) + { + itm = GetInventoryItem(item.ID); + itm.Folder = item.Folder; + if ((item.Name != null) && !item.Name.Equals(string.Empty)) + itm.Name = item.Name; + m_Database.updateInventoryItem(itm); + } + + return true; + } + // See IInventoryServices public virtual bool DeleteItems(UUID owner, List itemIDs) { -- cgit v1.1