From 2afd733229627b9ec59eb9a41e865a8d83d5d4c3 Mon Sep 17 00:00:00 2001 From: diva Date: Thu, 11 Jun 2009 20:27:13 +0000 Subject: Fixes mantis #3803. Thanks jhurliman. --- OpenSim/Framework/Communications/Tests/LoginServiceTests.cs | 2 +- .../ServiceConnectors/Inventory/HGInventoryBroker.cs | 2 +- .../Inventory/LocalInventoryServiceConnector.cs | 4 ++-- .../Inventory/RemoteInventoryServiceConnector.cs | 2 +- .../Server/Handlers/Inventory/InventoryServerInConnector.cs | 6 +++++- .../Inventory/QuickAndDirtyInventoryServiceConnector.cs | 2 +- OpenSim/Services/Interfaces/IInventoryService.cs | 3 ++- OpenSim/Services/InventoryService/InventoryService.cs | 10 +++++----- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index d637ef0..4070b49 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs @@ -497,7 +497,7 @@ namespace OpenSim.Framework.Communications.Tests { } - public List GetFolderItems(UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { return null; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs index 4d741a9..ac2eaed 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/HGInventoryBroker.cs @@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory } } - public List GetFolderItems(UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { return new List(); } diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs index ce64d4d..69a37a9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs @@ -170,9 +170,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory m_InventoryService.GetUserInventory(userID, callback); } - public List GetFolderItems(UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { - return m_InventoryService.GetFolderItems(folderID); + return m_InventoryService.GetFolderItems(userID, folderID); } /// diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/RemoteInventoryServiceConnector.cs index cd13c3d..5a31f23 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/RemoteInventoryServiceConnector.cs @@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory } - public List GetFolderItems(UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { return new List(); } diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 3e3064a..3354b84 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs @@ -159,7 +159,11 @@ namespace OpenSim.Server.Handlers.Inventory { List allItems = new List(); - List items = m_InventoryService.GetFolderItems(new UUID(folderID)); + // TODO: UUID.Zero is passed as the userID here, making the old assumption that the OpenSim + // inventory server only has a single inventory database and not per-user inventory databases. + // This could be changed but it requirs a bit of hackery to pass another parameter into this + // callback + List items = m_InventoryService.GetFolderItems(UUID.Zero, new UUID(folderID)); if (items != null) { diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs index 3264f41..fbb2707 100644 --- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs @@ -106,7 +106,7 @@ namespace OpenSim.Services.Connectors { } - public List GetFolderItems(UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { return null; } diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index 8757744..15da3cb 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs @@ -72,9 +72,10 @@ namespace OpenSim.Services.Interfaces /// /// Gets the items inside a folder /// + /// /// /// - List GetFolderItems(UUID folderID); + List GetFolderItems(UUID userID, UUID folderID); /// /// Add a new folder to the user's inventory diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 1190b38..86a903c 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs @@ -150,7 +150,7 @@ namespace OpenSim.Services.InventoryService foreach (InventoryFolderBase folder in allFolders) { - List items = GetFolderItems(folder.ID); + List items = GetFolderItems(userID, folder.ID); if (items != null) { @@ -205,7 +205,7 @@ namespace OpenSim.Services.InventoryService { rootFolder = new InventoryFolderImpl(folder); folders.Add(rootFolder); - items.AddRange(GetFolderItems(rootFolder.ID)); + items.AddRange(GetFolderItems(userID, rootFolder.ID)); break; // Only 1 root folder per user } } @@ -217,7 +217,7 @@ namespace OpenSim.Services.InventoryService if (folder.ID != rootFolder.ID) { folders.Add(new InventoryFolderImpl(folder)); - items.AddRange(GetFolderItems(folder.ID)); + items.AddRange(GetFolderItems(userID, folder.ID)); } } } @@ -255,7 +255,7 @@ namespace OpenSim.Services.InventoryService return inventoryList; } - public List GetFolderItems(UUID folderID) + public List GetFolderItems(UUID userID, UUID folderID) { List itemsList = new List(); @@ -377,7 +377,7 @@ namespace OpenSim.Services.InventoryService m_Database.deleteInventoryFolder(subFolder.ID); } - List items = GetFolderItems(folder.ID); + List items = GetFolderItems(folder.Owner, folder.ID); foreach (InventoryItemBase item in items) { -- cgit v1.1