diff options
author | Justin Clarke Casey | 2008-12-09 18:35:09 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-12-09 18:35:09 +0000 |
commit | 762712c02e4abf332d2d9a0ba583d6fe6f406aff (patch) | |
tree | 673471a2715e6a73dc051dbbd5b8dbed57cde8c2 /OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |
parent | * Apply terrain flip patch from http://opensimulator.org/mantis/view.php?id=2315 (diff) | |
download | opensim-SC-762712c02e4abf332d2d9a0ba583d6fe6f406aff.zip opensim-SC-762712c02e4abf332d2d9a0ba583d6fe6f406aff.tar.gz opensim-SC-762712c02e4abf332d2d9a0ba583d6fe6f406aff.tar.bz2 opensim-SC-762712c02e4abf332d2d9a0ba583d6fe6f406aff.tar.xz |
* Actually update subfolders of parent folders in the inventory cache when a folder gets moved
* This was causing inventory folder transfer code to not work properly (this is still temporarily disabled)
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index b4e7bfa..c8656d5 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -397,14 +397,14 @@ namespace OpenSim.Framework.Communications.Cache | |||
397 | 397 | ||
398 | /// <summary> | 398 | /// <summary> |
399 | /// Handle a client request to update the inventory folder | 399 | /// Handle a client request to update the inventory folder |
400 | /// </summary> | ||
400 | /// | 401 | /// |
401 | /// If the inventory service has not yet delievered the inventory | 402 | /// If the inventory service has not yet delievered the inventory |
402 | /// for this user then the request will be queued. | 403 | /// for this user then the request will be queued. |
403 | /// | 404 | /// |
404 | /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE | 405 | /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE |
405 | /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, | 406 | /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, |
406 | /// and needs to be changed. | 407 | /// and needs to be changed. |
407 | /// </summary> | ||
408 | /// | 408 | /// |
409 | /// <param name="folderID"></param> | 409 | /// <param name="folderID"></param> |
410 | /// <param name="type"></param> | 410 | /// <param name="type"></param> |
@@ -461,6 +461,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
461 | /// | 461 | /// |
462 | /// <param name="folderID"></param> | 462 | /// <param name="folderID"></param> |
463 | /// <param name="parentID"></param> | 463 | /// <param name="parentID"></param> |
464 | /// <returns> | ||
465 | /// true if the delete was successful, or if it was queued pending folder receipt | ||
466 | /// false if the folder to be deleted did not exist. | ||
467 | /// </returns> | ||
464 | public bool MoveFolder(UUID folderID, UUID parentID) | 468 | public bool MoveFolder(UUID folderID, UUID parentID) |
465 | { | 469 | { |
466 | // m_log.DebugFormat( | 470 | // m_log.DebugFormat( |
@@ -482,10 +486,27 @@ namespace OpenSim.Framework.Communications.Cache | |||
482 | { | 486 | { |
483 | m_commsManager.InventoryService.MoveFolder(baseFolder); | 487 | m_commsManager.InventoryService.MoveFolder(baseFolder); |
484 | } | 488 | } |
485 | 489 | ||
486 | InventoryFolderImpl folder = RootFolder.FindFolder(folderID); | 490 | InventoryFolderImpl folder = RootFolder.FindFolder(folderID); |
487 | if (folder != null) | 491 | InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID); |
488 | folder.ParentID = parentID; | 492 | if (parentFolder != null && folder != null) |
493 | { | ||
494 | InventoryFolderImpl oldParentFolder = RootFolder.FindFolder(folder.ParentID); | ||
495 | |||
496 | if (oldParentFolder != null) | ||
497 | { | ||
498 | oldParentFolder.RemoveChildFolder(folderID); | ||
499 | parentFolder.AddChildFolder(folder); | ||
500 | } | ||
501 | else | ||
502 | { | ||
503 | return false; | ||
504 | } | ||
505 | } | ||
506 | else | ||
507 | { | ||
508 | return false; | ||
509 | } | ||
489 | 510 | ||
490 | return true; | 511 | return true; |
491 | } | 512 | } |
@@ -502,10 +523,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
502 | 523 | ||
503 | /// <summary> | 524 | /// <summary> |
504 | /// This method will delete all the items and folders in the given folder. | 525 | /// This method will delete all the items and folders in the given folder. |
505 | /// | 526 | /// </summary> |
506 | /// If the inventory service has not yet delievered the inventory | 527 | /// If the inventory service has not yet delievered the inventory |
507 | /// for this user then the request will be queued. | 528 | /// for this user then the request will be queued. |
508 | /// </summary> | ||
509 | /// | 529 | /// |
510 | /// <param name="folderID"></param> | 530 | /// <param name="folderID"></param> |
511 | public bool PurgeFolder(UUID folderID) | 531 | public bool PurgeFolder(UUID folderID) |