aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs29
1 files changed, 24 insertions, 5 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index e3f6815..61ec483 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -496,6 +496,11 @@ namespace OpenSim.Framework.Communications.Cache
496 return new List<InventoryItemBase>(); 496 return new List<InventoryItemBase>();
497 } 497 }
498 498
499 /// <summary>
500 /// This should delete all the items and folders in the given directory.
501 /// </summary>
502 /// <param name="remoteClient"></param>
503 /// <param name="folderID"></param>
499 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) 504 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID)
500 { 505 {
501// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", 506// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}",
@@ -506,14 +511,28 @@ namespace OpenSim.Framework.Communications.Cache
506 { 511 {
507 if (userProfile.HasInventory) 512 if (userProfile.HasInventory)
508 { 513 {
509 InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID); 514 InventoryFolderImpl purgedFolder = userProfile.RootFolder.HasSubFolder(folderID);
510 if (subFolder != null) 515 if (purgedFolder != null)
511 { 516 {
512 List<InventoryItemBase> items = subFolder.RequestListOfItems(); 517 // XXX Nasty - have to create a new object to hold details we already have
518 InventoryFolderBase purgedBaseFolder = new InventoryFolderBase();
519 purgedBaseFolder.Owner = purgedFolder.Owner;
520 purgedBaseFolder.ID = purgedFolder.ID;
521 purgedBaseFolder.Name = purgedFolder.Name;
522 purgedBaseFolder.ParentID = purgedFolder.ParentID;
523 purgedBaseFolder.Type = purgedFolder.Type;
524 purgedBaseFolder.Version = purgedFolder.Version;
525
526 m_commsManager.InventoryService.PurgeInventoryFolder(remoteClient.AgentId, purgedBaseFolder);
527
528 // XXX Remains temporarily so that we still delete items in the grid case.
529 List<InventoryItemBase> items = purgedFolder.RequestListOfItems();
513 foreach (InventoryItemBase item in items) 530 foreach (InventoryItemBase item in items)
514 { 531 {
515 userProfile.DeleteItem(remoteClient.AgentId, item); 532 userProfile.DeleteItem(remoteClient.AgentId, item);
516 } 533 }
534
535 purgedFolder.Purge();
517 } 536 }
518 } 537 }
519 else 538 else