diff options
Diffstat (limited to 'OpenSim/Services/InventoryService')
-rw-r--r-- | OpenSim/Services/InventoryService/InventoryService.cs | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 65c2d96..e0217f6 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -386,13 +386,33 @@ 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 DeleteItem(InventoryItemBase item) | 408 | public virtual bool DeleteItems(UUID owner, List<UUID> itemIDs) |
391 | { | 409 | { |
392 | m_log.InfoFormat( | 410 | m_log.InfoFormat( |
393 | "[INVENTORY SERVICE]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); | 411 | "[INVENTORY SERVICE]: Deleting {0} items from user {1}", itemIDs.Count, owner); |
394 | 412 | ||
395 | m_Database.deleteInventoryItem(item.ID); | 413 | // uhh..... |
414 | foreach (UUID uuid in itemIDs) | ||
415 | m_Database.deleteInventoryItem(uuid); | ||
396 | 416 | ||
397 | // FIXME: Should return false on failure | 417 | // FIXME: Should return false on failure |
398 | return true; | 418 | return true; |
@@ -439,10 +459,12 @@ namespace OpenSim.Services.InventoryService | |||
439 | 459 | ||
440 | List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID); | 460 | List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID); |
441 | 461 | ||
462 | List<UUID> uuids = new List<UUID>(); | ||
442 | foreach (InventoryItemBase item in items) | 463 | foreach (InventoryItemBase item in items) |
443 | { | 464 | { |
444 | DeleteItem(item); | 465 | uuids.Add(item.ID); |
445 | } | 466 | } |
467 | DeleteItems(folder.Owner, uuids); | ||
446 | 468 | ||
447 | // FIXME: Should return false on failure | 469 | // FIXME: Should return false on failure |
448 | return true; | 470 | return true; |