aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/InventoryService')
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 0e7a358..15156d0 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -52,6 +52,7 @@ namespace OpenSim.Services.InventoryService
52 : this(config, "InventoryService") 52 : this(config, "InventoryService")
53 { 53 {
54 } 54 }
55
55 public XInventoryService(IConfigSource config, string configName) : base(config) 56 public XInventoryService(IConfigSource config, string configName) : base(config)
56 { 57 {
57 if (configName != string.Empty) 58 if (configName != string.Empty)
@@ -364,6 +365,11 @@ namespace OpenSim.Services.InventoryService
364 // 365 //
365 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) 366 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
366 { 367 {
368 return DeleteFolders(principalID, folderIDs, true);
369 }
370
371 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs, bool onlyIfTrash)
372 {
367 if (!m_AllowDelete) 373 if (!m_AllowDelete)
368 return false; 374 return false;
369 375
@@ -371,11 +377,12 @@ namespace OpenSim.Services.InventoryService
371 // 377 //
372 foreach (UUID id in folderIDs) 378 foreach (UUID id in folderIDs)
373 { 379 {
374 if (!ParentIsTrash(id)) 380 if (onlyIfTrash && !ParentIsTrash(id))
375 continue; 381 continue;
382 //m_log.InfoFormat("[XINVENTORY SERVICE]: Delete folder {0}", id);
376 InventoryFolderBase f = new InventoryFolderBase(); 383 InventoryFolderBase f = new InventoryFolderBase();
377 f.ID = id; 384 f.ID = id;
378 PurgeFolder(f); 385 PurgeFolder(f, onlyIfTrash);
379 m_Database.DeleteFolders("folderID", id.ToString()); 386 m_Database.DeleteFolders("folderID", id.ToString());
380 } 387 }
381 388
@@ -384,10 +391,15 @@ namespace OpenSim.Services.InventoryService
384 391
385 public virtual bool PurgeFolder(InventoryFolderBase folder) 392 public virtual bool PurgeFolder(InventoryFolderBase folder)
386 { 393 {
394 return PurgeFolder(folder, true);
395 }
396
397 public virtual bool PurgeFolder(InventoryFolderBase folder, bool onlyIfTrash)
398 {
387 if (!m_AllowDelete) 399 if (!m_AllowDelete)
388 return false; 400 return false;
389 401
390 if (!ParentIsTrash(folder.ID)) 402 if (onlyIfTrash && !ParentIsTrash(folder.ID))
391 return false; 403 return false;
392 404
393 XInventoryFolder[] subFolders = m_Database.GetFolders( 405 XInventoryFolder[] subFolders = m_Database.GetFolders(
@@ -396,7 +408,7 @@ namespace OpenSim.Services.InventoryService
396 408
397 foreach (XInventoryFolder x in subFolders) 409 foreach (XInventoryFolder x in subFolders)
398 { 410 {
399 PurgeFolder(ConvertToOpenSim(x)); 411 PurgeFolder(ConvertToOpenSim(x), onlyIfTrash);
400 m_Database.DeleteFolders("folderID", x.folderID.ToString()); 412 m_Database.DeleteFolders("folderID", x.folderID.ToString());
401 } 413 }
402 414