Thank you very much Ahzzmandius for adding the support

to purge the avatars inventory "Trash" folder using the
bizarre tortoiseSVN method of diff/patch.
This commit is contained in:
Charles Krinke
2008-02-18 03:25:14 +00:00
parent 3df36523cb
commit 2c81e18fc3
5 changed files with 79 additions and 0 deletions

View File

@@ -476,6 +476,51 @@ namespace OpenSim.Region.Environment.Scenes
}
}
private void RemoveInventoryItem(IClientAPI remoteClient, LLUUID itemID)
{
CachedUserInfo userInfo
= CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
if (userInfo == null)
{
m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
return;
}
// is going through the root folder really the best way?
// this triggers a tree walk to find and remove the item. 8-(
// since this only happens in Trash (in theory) shouldn't we grab
// the trash folder directly instead of RootFolder?
if (userInfo.RootFolder != null)
{
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
if (item != null)
{
userInfo.DeleteItem(remoteClient.AgentId, item);
}
}
}
private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID)
{
CachedUserInfo userInfo
= CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
if (userInfo == null)
{
m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
return;
}
if (userInfo.RootFolder != null)
{
InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID);
if (folder != null)
{
// doesn't work just yet, commented out. WIll fix in next patch.
// userInfo.DeleteItem(remoteClient.AgentId, folder);
}
}
}
private SceneObjectGroup GetGroupByPrim(uint localID)
{
List<EntityBase> EntitieList = GetEntities();

View File

@@ -1397,6 +1397,8 @@ namespace OpenSim.Region.Environment.Scenes
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
client.OnCopyInventoryItem += CopyInventoryItem;
client.OnMoveInventoryItem += MoveInventoryItem;
client.OnRemoveInventoryItem += RemoveInventoryItem;
client.OnRemoveInventoryFolder += RemoveInventoryFolder;
// client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest;
// client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer;
client.OnRezScript += RezScript;