From 45430a5403ec45abceac123a76cb7a0c61475b5e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 3 May 2008 19:27:34 +0000 Subject: * Refactor: move UpdateFolder into CachedUserInfo --- .../Cache/UserProfileCacheService.cs | 23 ++++------------------ 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs') diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 71da8dc..f640fb8 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -36,8 +36,6 @@ namespace OpenSim.Framework.Communications.Cache { internal delegate void MoveInventoryFolderDelegate(IClientAPI remoteClient, LLUUID folderID, LLUUID parentID); internal delegate void PurgeInventoryDescendentsDelegate(IClientAPI remoteClient, LLUUID folderID); - internal delegate void UpdateInventoryFolderDelegate( - IClientAPI remoteClient, LLUUID folderID, ushort type, string name, LLUUID parentID); /// /// Holds user profile information and retrieves it from backend services. @@ -198,24 +196,11 @@ namespace OpenSim.Framework.Communications.Cache if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) { - if (userProfile.HasInventory) - { - InventoryFolderBase baseFolder = new InventoryFolderBase(); - baseFolder.Owner = remoteClient.AgentId; - baseFolder.ID = folderID; - baseFolder.Name = name; - baseFolder.ParentID = parentID; - baseFolder.Type = (short) type; - baseFolder.Version = userProfile.RootFolder.Version; - - m_commsManager.InventoryService.AddFolder(baseFolder); - } - else + if (!userProfile.UpdateFolder(name, folderID, type, parentID)) { - userProfile.AddRequest( - new InventoryRequest( - Delegate.CreateDelegate(typeof(UpdateInventoryFolderDelegate), this, "HandleUpdateInventoryFolder"), - new object[] { remoteClient, folderID, type, name, parentID })); + m_log.ErrorFormat( + "[AGENT INVENTORY]: Failed to create folder for user {0} {1}", + remoteClient.Name, remoteClient.AgentId); } } else -- cgit v1.1