From 976cf4284bdbef14553c2e164cb67d25bd2b9076 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 29 Aug 2009 03:26:44 +0100 Subject: Fix up WebFetchInventoryDescendents to really return all data needed, especially the folder version and the subfolders. Fixes inventory search hang and folders not loading. --- .../Region/Framework/Scenes/Scene.PacketHandlers.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index c816790..55b100b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -473,7 +473,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// null if the inventory look up failed public InventoryCollection HandleFetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID, - bool fetchFolders, bool fetchItems, int sortOrder) + bool fetchFolders, bool fetchItems, int sortOrder, out int version) { // m_log.DebugFormat( // "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", @@ -487,6 +487,7 @@ namespace OpenSim.Region.Framework.Scenes InventoryFolderImpl fold; if ((fold = CommsManager.UserProfileCacheService.LibraryRoot.FindFolder(folderID)) != null) { + version = 0; InventoryCollection ret = new InventoryCollection(); ret.Folders = new List(); ret.Items = fold.RequestListOfItems(); @@ -495,6 +496,21 @@ namespace OpenSim.Region.Framework.Scenes } InventoryCollection contents = InventoryService.GetFolderContent(agentID, folderID); + + if (folderID != UUID.Zero) + { + InventoryFolderBase containingFolder = new InventoryFolderBase(); + containingFolder.ID = folderID; + containingFolder.Owner = agentID; + containingFolder = InventoryService.GetFolder(containingFolder); + version = containingFolder.Version; + } + else + { + // Lost itemsm don't really need a version + version = 1; + } + return contents; } -- cgit v1.1