From 383eccc543e402710bb48802c6951b94d185a6a8 Mon Sep 17 00:00:00 2001
From: Brian McBee
Date: Sat, 8 Dec 2007 20:41:37 +0000
Subject: hackish code to allow emptying of trash. This really should be done
on the inventory server, and not from the region. Also: it appeared to work
the first try, so I have probably done something horribly wrong.
---
.../Cache/UserProfileCacheService.cs | 22 +++++++++++++++++++++-
OpenSim/Framework/IClientAPI.cs | 4 ++++
2 files changed, 25 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index fb4c3a6..342bb0d 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -136,7 +136,7 @@ namespace OpenSim.Framework.Communications.Cache
///
///
///
- public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID,
+ public void HandleFetchInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID,
bool fetchFolders, bool fetchItems, int sortOrder)
{
InventoryFolderImpl fold = null;
@@ -181,6 +181,26 @@ namespace OpenSim.Framework.Communications.Cache
}
}
+ public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID)
+ {
+ CachedUserInfo userProfile;
+ if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
+ {
+ if (userProfile.RootFolder != null)
+ {
+ InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID);
+ if (subFolder != null)
+ {
+ List items=subFolder.RequestListOfItems();
+ foreach(InventoryItemBase item in items)
+ {
+ userProfile.DeleteItem(remoteClient.AgentId, item);
+ }
+ }
+ }
+ }
+ }
+
public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
{
if (ownerID == libraryRoot.agentID)
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 38309fd..773b5eb 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -306,6 +306,9 @@ namespace OpenSim.Framework
public delegate void FetchInventoryDescendents(
IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
+ public delegate void PurgeInventoryDescendents(
+ IClientAPI remoteClient, LLUUID folderID);
+
public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID);
public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID);
@@ -398,6 +401,7 @@ namespace OpenSim.Framework
event CreateNewInventoryItem OnCreateNewInventoryItem;
event CreateInventoryFolder OnCreateNewInventoryFolder;
event FetchInventoryDescendents OnFetchInventoryDescendents;
+ event PurgeInventoryDescendents OnPurgeInventoryDescendents;
event FetchInventory OnFetchInventory;
event RequestTaskInventory OnRequestTaskInventory;
event UpdateInventoryItem OnUpdateInventoryItem;
--
cgit v1.1