From ee5774208ff3f025eb1f61896d289f62c5a81726 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 4 May 2009 17:16:01 +0000 Subject: * Enhance some internal inventory data plugin behaviour to match what was probably intended * (e.g returning combined results of plugin rather than always the first result) * This will not affect any existing functionality --- .../Framework/Communications/IInventoryServices.cs | 2 +- .../Communications/InventoryServiceBase.cs | 31 +++++++++++++--------- .../Communications/TemporaryUserProfilePlugin.cs | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index e37b188..3f1e9ef 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -134,4 +134,4 @@ namespace OpenSim.Framework.Communications /// null if no root folder was found InventoryFolderBase RequestRootFolder(UUID userID); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index ff66250..0909a52 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -117,11 +117,15 @@ namespace OpenSim.Framework.Communications // See IInventoryServices public virtual InventoryFolderBase RequestRootFolder(UUID userID) { - // FIXME: Probably doesn't do what was originally intended - only ever queries the first plugin + // Retrieve the first root folder we get from the list of plugins. foreach (IInventoryDataPlugin plugin in m_plugins) { - return plugin.getUserRootFolder(userID); + InventoryFolderBase rootFolder = plugin.getUserRootFolder(userID); + if (rootFolder != null) + return rootFolder; } + + // Return nothing if no plugin was able to supply a root folder return null; } @@ -154,11 +158,13 @@ namespace OpenSim.Framework.Communications public List GetActiveGestures(UUID userId) { + List activeGestures = new List(); foreach (IInventoryDataPlugin plugin in m_plugins) { - return plugin.fetchActiveGestures(userId); + activeGestures.AddRange(plugin.fetchActiveGestures(userId)); } - return new List(); + + return activeGestures; } #endregion @@ -168,21 +174,24 @@ namespace OpenSim.Framework.Communications public List RequestSubFolders(UUID parentFolderID) { List inventoryList = new List(); + foreach (IInventoryDataPlugin plugin in m_plugins) { - return plugin.getInventoryFolders(parentFolderID); + inventoryList.AddRange(plugin.getInventoryFolders(parentFolderID)); } + return inventoryList; } public List RequestFolderItems(UUID folderID) { List itemsList = new List(); + foreach (IInventoryDataPlugin plugin in m_plugins) { - itemsList = plugin.getInventoryInFolder(folderID); - return itemsList; + itemsList.AddRange(plugin.getInventoryInFolder(folderID)); } + return itemsList; } @@ -284,9 +293,7 @@ namespace OpenSim.Framework.Communications { InventoryItemBase result = plugin.queryInventoryItem(item.ID); if (result != null) - { return result; - } } return null; @@ -298,9 +305,7 @@ namespace OpenSim.Framework.Communications { InventoryFolderBase result = plugin.queryInventoryFolder(item.ID); if (result != null) - { return result; - } } return null; @@ -353,7 +358,9 @@ namespace OpenSim.Framework.Communications { foreach (IInventoryDataPlugin plugin in m_plugins) { - return plugin.getInventoryItem(itemID); + InventoryItemBase item = plugin.getInventoryItem(itemID); + if (item != null) + return item; } return null; diff --git a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs index 7478cdd..ba14790 100644 --- a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs +++ b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs @@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications public virtual void AddTemporaryUserProfile(UserProfileData userProfile) { - m_log.DebugFormat("[TEMP USER PROFILE]: Adding {0} {1}", userProfile.Name, userProfile.ID); + //m_log.DebugFormat("[TEMP USER PROFILE]: Adding {0} {1}", userProfile.Name, userProfile.ID); lock (m_profiles) { -- cgit v1.1