diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 2212216..13fa009 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -476,6 +476,51 @@ namespace OpenSim.Region.Environment.Scenes | |||
476 | } | 476 | } |
477 | } | 477 | } |
478 | 478 | ||
479 | private void RemoveInventoryItem(IClientAPI remoteClient, LLUUID itemID) | ||
480 | { | ||
481 | CachedUserInfo userInfo | ||
482 | = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
483 | if (userInfo == null) | ||
484 | { | ||
485 | m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); | ||
486 | return; | ||
487 | } | ||
488 | |||
489 | // is going through the root folder really the best way? | ||
490 | // this triggers a tree walk to find and remove the item. 8-( | ||
491 | // since this only happens in Trash (in theory) shouldn't we grab | ||
492 | // the trash folder directly instead of RootFolder? | ||
493 | if (userInfo.RootFolder != null) | ||
494 | { | ||
495 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | ||
496 | if (item != null) | ||
497 | { | ||
498 | userInfo.DeleteItem(remoteClient.AgentId, item); | ||
499 | } | ||
500 | } | ||
501 | } | ||
502 | |||
503 | private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID) | ||
504 | { | ||
505 | CachedUserInfo userInfo | ||
506 | = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
507 | if (userInfo == null) | ||
508 | { | ||
509 | m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); | ||
510 | return; | ||
511 | } | ||
512 | |||
513 | if (userInfo.RootFolder != null) | ||
514 | { | ||
515 | InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID); | ||
516 | if (folder != null) | ||
517 | { | ||
518 | // doesn't work just yet, commented out. WIll fix in next patch. | ||
519 | // userInfo.DeleteItem(remoteClient.AgentId, folder); | ||
520 | } | ||
521 | } | ||
522 | } | ||
523 | |||
479 | private SceneObjectGroup GetGroupByPrim(uint localID) | 524 | private SceneObjectGroup GetGroupByPrim(uint localID) |
480 | { | 525 | { |
481 | List<EntityBase> EntitieList = GetEntities(); | 526 | List<EntityBase> EntitieList = GetEntities(); |