From cdcbc48534f19afe7cbdeb6c690e6b7d9f2ff099 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 10 Aug 2009 20:31:51 -0700 Subject: Added two new methods to IIventoryService -- GetFolderForType and GetFolderContent. Some meat to it, but not completed. None of this code is called anywhere yet. --- .../Services/InventoryService/InventoryService.cs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'OpenSim/Services/InventoryService/InventoryService.cs') diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 2b8ee0f..dd435c9 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs @@ -233,6 +233,46 @@ namespace OpenSim.Services.InventoryService callback.BeginInvoke(folders, items, null, null); } + public InventoryCollection GetFolderContent(UUID userID, UUID folderID) + { + m_log.Info("[INVENTORY SERVICE]: Processing request for folder " + folderID); + + // Uncomment me to simulate a slow responding inventory server + //Thread.Sleep(16000); + + InventoryCollection invCollection = new InventoryCollection(); + + List items = GetFolderItems(userID, folderID); + List folders = RequestSubFolders(folderID); + + invCollection.UserID = userID; + invCollection.Folders = folders; + invCollection.Items = items; + + m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders", items.Count, folders.Count); + + return invCollection; + } + + public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) + { + InventoryFolderBase root = m_Database.getUserRootFolder(userID); + if (root != null) + { + List folders = RequestSubFolders(root.ID); + + foreach (InventoryFolderBase folder in folders) + { + if (folder.Type == (short)type) + return folder; + } + } + + // we didn't find any folder of that type. Return the root folder + // hopefully the root folder is not null. If it is, too bad + return root; + } + public List GetActiveGestures(UUID userId) { List activeGestures = new List(); -- cgit v1.1