From a5dfca8958a28da415719ba880a77138ec205842 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Sat, 3 May 2008 18:13:32 +0000
Subject: * Refactor: remove redundant userId parameter from UpdateItem() and
DeleteItem() * Put warning in remove folder method about non implementation
(not that this is used anyway - may be legacy)
---
.../Communications/Cache/CachedUserInfo.cs | 8 ++++----
.../AssetTransaction/AgentAssetsTransactions.cs | 2 +-
.../Region/Environment/Scenes/Scene.Inventory.cs | 21 ++++++++++++++++-----
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index ca9669a..86c24bc 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -316,9 +316,9 @@ namespace OpenSim.Framework.Communications.Cache
///
///
///
- public void UpdateItem(LLUUID userID, InventoryItemBase itemInfo)
+ public void UpdateItem(InventoryItemBase itemInfo)
{
- if ((userID == UserProfile.ID) && HasInventory)
+ if (HasInventory)
{
m_commsManager.InventoryService.UpdateItem(itemInfo);
}
@@ -330,10 +330,10 @@ namespace OpenSim.Framework.Communications.Cache
///
///
///
- public bool DeleteItem(LLUUID userID, InventoryItemBase item)
+ public bool DeleteItem(InventoryItemBase item)
{
bool result = false;
- if ((userID == UserProfile.ID) && HasInventory)
+ if (HasInventory)
{
result = RootFolder.DeleteItem(item.ID);
if (result)
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 19d2913..9a6b83a 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -364,7 +364,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset);
}
- userInfo.UpdateItem(remoteClient.AgentId, item);
+ userInfo.UpdateItem(item);
}
}
}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index baca696..59c45fa 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Scenes
AssetCache.AddAsset(asset);
item.AssetID = asset.FullID;
- userInfo.UpdateItem(remoteClient.AgentId, item);
+ userInfo.UpdateItem(item);
// remoteClient.SendInventoryItemCreateUpdate(item);
if ((InventoryType) item.InvType == InventoryType.Notecard)
@@ -294,7 +294,7 @@ namespace OpenSim.Region.Environment.Scenes
item.SaleType = itemUpd.SaleType;
item.Flags = itemUpd.Flags;
- userInfo.UpdateItem(remoteClient.AgentId, item);
+ userInfo.UpdateItem(item);
}
else
{
@@ -486,7 +486,7 @@ namespace OpenSim.Region.Environment.Scenes
item.Name = newName;
}
item.Folder = folderID;
- userInfo.DeleteItem(remoteClient.AgentId, item);
+ userInfo.DeleteItem(item);
// TODO: preserve current permissions?
AddInventoryItem(remoteClient, item);
@@ -630,11 +630,17 @@ namespace OpenSim.Region.Environment.Scenes
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
if (item != null)
{
- userInfo.DeleteItem(remoteClient.AgentId, item);
+ userInfo.DeleteItem(item);
}
}
}
+ ///
+ /// Removes an inventory folder. Although there is a packet in the Linden protocol for this, it may be
+ /// legacy and not currently used (purge folder is used to remove folders from trash instead).
+ ///
+ ///
+ ///
private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID)
{
CachedUserInfo userInfo
@@ -648,10 +654,15 @@ namespace OpenSim.Region.Environment.Scenes
if (userInfo.RootFolder != null)
{
InventoryItemBase folder = userInfo.RootFolder.HasItem(folderID);
+
if (folder != null)
{
+ m_log.WarnFormat(
+ "[AGENT INVENTORY]: Remove folder not implemented in request by {0} {1} for {2}",
+ remoteClient.Name, remoteClient.AgentId, folderID);
+
// doesn't work just yet, commented out. will fix in next patch.
- // userInfo.DeleteItem(remoteClient.AgentId, folder);
+ // userInfo.DeleteItem(folder);
}
}
}
--
cgit v1.1