From fba9e3f513a0d9b4e0ccaf5a9fe24899d96e98c8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 23 Nov 2008 20:39:51 +0000 Subject: Don't serve texture preview from other people's objects if you havenever seen that texture before. --- .../Communications/Cache/InventoryFolderImpl.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'OpenSim/Framework/Communications/Cache') diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index f78cdee..8e624f9 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -138,6 +138,33 @@ namespace OpenSim.Framework.Communications.Cache return null; } + public InventoryItemBase FindAsset(UUID assetID) + { + lock (Items) + { + foreach (InventoryItemBase item in Items.Values) + { + if (item.AssetID == assetID) + return item; + } + } + + lock (SubFolders) + { + foreach (InventoryFolderImpl folder in SubFolders.Values) + { + InventoryItemBase item = folder.FindAsset(assetID); + + if (item != null) + { + return item; + } + } + } + + return null; + } + /// /// Deletes an item if it exists in this folder or any children /// -- cgit v1.1