From f8e0653e73932bae20f483e0ce669f1623c6ff1e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 5 May 2009 16:45:21 +0000 Subject: * If an item creator id contains an iar loaded name, create a temporary profile and hashed UUID to represent the user --- .../Osp/OspInventoryWrapperPlugin.cs | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs') diff --git a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs index 3a692ae..95ef484 100644 --- a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs +++ b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs @@ -37,10 +37,12 @@ namespace OpenSim.Framework.Communications.Osp public class OspInventoryWrapperPlugin : IInventoryDataPlugin { protected IInventoryDataPlugin m_wrappedPlugin; + protected CommunicationsManager m_commsManager; - public OspInventoryWrapperPlugin(IInventoryDataPlugin wrappedPlugin) + public OspInventoryWrapperPlugin(IInventoryDataPlugin wrappedPlugin, CommunicationsManager commsManager) { m_wrappedPlugin = wrappedPlugin; + m_commsManager = commsManager; } public string Name { get { return "OspInventoryWrapperPlugin"; } } @@ -51,24 +53,23 @@ namespace OpenSim.Framework.Communications.Osp public InventoryItemBase getInventoryItem(UUID item) { - return m_wrappedPlugin.getInventoryItem(item); - - // TODO: Need to post process here + return PostProcessItem(m_wrappedPlugin.getInventoryItem(item)); } // XXX: Why on earth does this exist as it appears to duplicate getInventoryItem? public InventoryItemBase queryInventoryItem(UUID item) { - return m_wrappedPlugin.queryInventoryItem(item); - - // TODO: Need to post process here + return PostProcessItem(m_wrappedPlugin.queryInventoryItem(item)); } public List getInventoryInFolder(UUID folderID) { - return m_wrappedPlugin.getInventoryInFolder(folderID); + List items = m_wrappedPlugin.getInventoryInFolder(folderID); - // TODO: Need to post process here + foreach (InventoryItemBase item in items) + PostProcessItem(item); + + return items; } public List fetchActiveGestures(UUID avatarID) @@ -77,6 +78,12 @@ namespace OpenSim.Framework.Communications.Osp // Presuming that no post processing is needed here as gestures don't refer to creator information (?) } + + protected InventoryItemBase PostProcessItem(InventoryItemBase item) + { + item.CreatorIdAsUuid = OspResolver.ResolveOspa(item.CreatorId, m_commsManager); + return item; + } public List getFolderHierarchy(UUID parentID) { return m_wrappedPlugin.getFolderHierarchy(parentID); } public List getUserRootFolders(UUID user) { return m_wrappedPlugin.getUserRootFolders(user); } -- cgit v1.1