aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/CachedUserInfo.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index e590b9d..8d36623 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -37,6 +37,7 @@ namespace OpenSim.Framework.Communications.Cache
37 internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo); 37 internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo);
38 internal delegate void DeleteItemDelegate(UUID itemID); 38 internal delegate void DeleteItemDelegate(UUID itemID);
39 internal delegate void QueryItemDelegate(UUID itemID); 39 internal delegate void QueryItemDelegate(UUID itemID);
40 internal delegate void QueryFolderDelegate(UUID folderID);
40 41
41 internal delegate void CreateFolderDelegate(string folderName, UUID folderID, ushort folderType, UUID parentID); 42 internal delegate void CreateFolderDelegate(string folderName, UUID folderID, ushort folderType, UUID parentID);
42 internal delegate void MoveFolderDelegate(UUID folderID, UUID parentID); 43 internal delegate void MoveFolderDelegate(UUID folderID, UUID parentID);
@@ -819,6 +820,56 @@ namespace OpenSim.Framework.Communications.Cache
819 return false; 820 return false;
820 } 821 }
821 822
823 public bool QueryFolder(InventoryFolderBase folder)
824 {
825 if (m_hasReceivedInventory)
826 {
827 InventoryFolderBase invFolder = RootFolder.FindFolder(folder.ID);
828
829 if (invFolder != null)
830 {
831 // Folder is in local cache, just update client
832 //
833 return true;
834 }
835
836 InventoryFolderBase folderInfo = null;
837
838 if (m_commsManager.SecureInventoryService != null)
839 {
840 folderInfo = m_commsManager.SecureInventoryService.QueryFolder(folder, m_session_id);
841 }
842 else
843 {
844 folderInfo = m_commsManager.InventoryService.QueryFolder(folder);
845 }
846
847 if (folderInfo != null)
848 {
849 InventoryFolderImpl createdFolder = RootFolder.CreateChildFolder(folderInfo.ID, folderInfo.Name, (ushort)folderInfo.Type);
850
851 createdFolder.Version = folderInfo.Version;
852 createdFolder.Owner = folderInfo.Owner;
853 createdFolder.ParentID = folderInfo.ParentID;
854
855 return true;
856 }
857
858 return false;
859 }
860 else
861 {
862 AddRequest(
863 new InventoryRequest(
864 Delegate.CreateDelegate(typeof(QueryFolderDelegate), this, "QueryFolder"),
865 new object[] { folder.ID }));
866
867 return true;
868 }
869
870 return false;
871 }
872
822 } 873 }
823 874
824 /// <summary> 875 /// <summary>