diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 966ab75558..ecc6c710df 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -85,8 +85,8 @@ namespace OpenSim.Framework.Communications
/// Returns a list of all the folders in a given user's inventory.
///
///
- /// A flat list of the user's inventory folder tree.
- /// Null if there is no inventory for this user
+ /// A flat list of the user's inventory folder tree,
+ /// null if there is no inventory for this user
List GetInventorySkeleton(LLUUID userId);
}
}
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index f9a47b190e..e50e19e0a3 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -141,7 +141,7 @@ namespace OpenSim.Framework.Communications
if (null != existingRootFolder)
{
- m_log.ErrorFormat(
+ m_log.WarnFormat(
"[AGENT INVENTORY]: Did not create a new inventory for user {0} since they already have "
+ "a root inventory folder with id {1}",
user, existingRootFolder.ID);
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
index ffff89fe5f..e30c31e2d0 100644
--- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs
+++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
@@ -43,7 +43,14 @@ namespace OpenSim.Grid.InventoryServer
{
}
- private bool TryGetUsersInventory(LLUUID userID, out List folderList,
+ ///
+ /// Get a user's inventory.
+ ///
+ ///
+ ///
+ ///
+ /// true if the inventory was retrieved, false otherwise
+ private bool GetUsersInventory(LLUUID userID, out List folderList,
out List itemsList)
{
List allFolders = GetInventorySkeleton(userID);
@@ -93,23 +100,40 @@ namespace OpenSim.Grid.InventoryServer
/// Return a user's entire inventory
///
///
- ///
+ /// The user's inventory. If an inventory cannot be found then an empty collection is returned.
public InventoryCollection GetUserInventory(Guid rawUserID)
{
LLUUID userID = new LLUUID(rawUserID);
- m_log.Info("[AGENT INVENTORY]: Processing request for inventory of " + userID.ToString());
+ m_log.InfoFormat("[AGENT INVENTORY]: Processing request for inventory of {0}", userID);
InventoryCollection invCollection = new InventoryCollection();
- List folders;
- List allItems;
- if (TryGetUsersInventory(userID, out folders, out allItems))
+
+ List allFolders = GetInventorySkeleton(userID);
+
+ if (null == allFolders)
{
- invCollection.AllItems = allItems;
- invCollection.Folders = folders;
- invCollection.UserID = userID;
+ m_log.WarnFormat("[AGENT INVENTORY]: No inventory found for user {0}", rawUserID);
+
+ return invCollection;
}
+ List allItems = new List();
+
+ foreach (InventoryFolderBase folder in allFolders)
+ {
+ List items = RequestFolderItems(folder.ID);
+
+ if (items != null)
+ {
+ allItems.InsertRange(0, items);
+ }
+ }
+
+ invCollection.AllItems = allItems;
+ invCollection.Folders = allFolders;
+ invCollection.UserID = userID;
+
// foreach (InventoryFolderBase folder in folders)
// {
// m_log.DebugFormat(