diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs | 8 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 29 |
2 files changed, 27 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index daf9ab5..7812499 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs | |||
@@ -79,14 +79,12 @@ namespace OpenSim.Framework.Communications.Cache | |||
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
81 | /// Delete all the folders and items in this folder. | 81 | /// Delete all the folders and items in this folder. |
82 | /// | ||
83 | /// TODO: This method is not used yet, but will be shortly | ||
84 | /// </summary> | 82 | /// </summary> |
85 | public void DeleteAllContents() | 83 | public void Purge() |
86 | { | 84 | { |
87 | foreach (InventoryFolderImpl folder in SubFolders.Values) | 85 | foreach (InventoryFolderImpl folder in SubFolders.Values) |
88 | { | 86 | { |
89 | folder.DeleteAllContents(); | 87 | folder.Purge(); |
90 | } | 88 | } |
91 | 89 | ||
92 | SubFolders.Clear(); | 90 | SubFolders.Clear(); |
@@ -206,7 +204,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
206 | } | 204 | } |
207 | 205 | ||
208 | /// <summary> | 206 | /// <summary> |
209 | /// Return the list of folders in this folder | 207 | /// Return the list of immediate child folders in this folder. |
210 | /// </summary> | 208 | /// </summary> |
211 | public List<InventoryFolderBase> RequestListOfFolders() | 209 | public List<InventoryFolderBase> RequestListOfFolders() |
212 | { | 210 | { |
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 |