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 --- .../Communications/InventoryServiceBase.cs | 31 +++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'OpenSim/Framework/Communications/InventoryServiceBase.cs') 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; -- cgit v1.1