diff options
author | Melanie Thielker | 2016-07-04 03:35:48 +0100 |
---|---|---|
committer | Melanie Thielker | 2016-07-04 03:35:48 +0100 |
commit | ea8f3c83bf96453e8223d918933d5708fa49a3cc (patch) | |
tree | 288972a5d6f112426da2b5ab109fe18ba5aedc2e /OpenSim/Capabilities | |
parent | increase xmlrpc timeout in xmlrpcgroups, disable its cache until its entries ... (diff) | |
download | opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.zip opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.tar.gz opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.tar.bz2 opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.tar.xz |
Finally remove the requirement for an InventoryItem/FolderBase object to
be passed into inventory queries.
This makes the API more homogenous and also will more clearly show
coding
errors related to HG inventory where the .Owner field has a meaning
for a query but wasn't always set.
Diffstat (limited to 'OpenSim/Capabilities')
-rw-r--r-- | OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs | 19 | ||||
-rw-r--r-- | OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs | 15 |
2 files changed, 8 insertions, 26 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs index 4da6c3d..e3a9a22 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs | |||
@@ -403,10 +403,7 @@ namespace OpenSim.Capabilities.Handlers | |||
403 | return contents; | 403 | return contents; |
404 | } | 404 | } |
405 | contents = fetchedContents; | 405 | contents = fetchedContents; |
406 | InventoryFolderBase containingFolder = new InventoryFolderBase(); | 406 | InventoryFolderBase containingFolder = m_InventoryService.GetFolder(agentID, folderID); |
407 | containingFolder.ID = folderID; | ||
408 | containingFolder.Owner = agentID; | ||
409 | containingFolder = m_InventoryService.GetFolder(containingFolder); | ||
410 | 407 | ||
411 | if (containingFolder != null) | 408 | if (containingFolder != null) |
412 | { | 409 | { |
@@ -429,7 +426,7 @@ namespace OpenSim.Capabilities.Handlers | |||
429 | { | 426 | { |
430 | if (item.AssetType == (int)AssetType.Link) | 427 | if (item.AssetType == (int)AssetType.Link) |
431 | { | 428 | { |
432 | InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); | 429 | InventoryItemBase linkedItem = m_InventoryService.GetItem(agentID, item.AssetID); |
433 | 430 | ||
434 | // Take care of genuinely broken links where the target doesn't exist | 431 | // Take care of genuinely broken links where the target doesn't exist |
435 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | 432 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, |
@@ -659,10 +656,7 @@ from docs seems this was never a spec | |||
659 | // Must fetch it individually | 656 | // Must fetch it individually |
660 | else if (contents.FolderID == UUID.Zero) | 657 | else if (contents.FolderID == UUID.Zero) |
661 | { | 658 | { |
662 | InventoryFolderBase containingFolder = new InventoryFolderBase(); | 659 | InventoryFolderBase containingFolder = m_InventoryService.GetFolder(freq.owner_id, freq.folder_id); |
663 | containingFolder.ID = freq.folder_id; | ||
664 | containingFolder.Owner = freq.owner_id; | ||
665 | containingFolder = m_InventoryService.GetFolder(containingFolder); | ||
666 | 660 | ||
667 | if (containingFolder != null) | 661 | if (containingFolder != null) |
668 | { | 662 | { |
@@ -759,12 +753,9 @@ from docs seems this was never a spec | |||
759 | m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); | 753 | m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); |
760 | linked = new InventoryItemBase[itemIDs.Count]; | 754 | linked = new InventoryItemBase[itemIDs.Count]; |
761 | int i = 0; | 755 | int i = 0; |
762 | InventoryItemBase item = new InventoryItemBase(); | ||
763 | item.Owner = freq.owner_id; | ||
764 | foreach (UUID id in itemIDs) | 756 | foreach (UUID id in itemIDs) |
765 | { | 757 | { |
766 | item.ID = id; | 758 | linked[i++] = m_InventoryService.GetItem(freq.owner_id, id); |
767 | linked[i++] = m_InventoryService.GetItem(item); | ||
768 | } | 759 | } |
769 | } | 760 | } |
770 | 761 | ||
@@ -850,4 +841,4 @@ from docs seems this was never a spec | |||
850 | public InventoryCollection Collection; | 841 | public InventoryCollection Collection; |
851 | public int Descendents; | 842 | public int Descendents; |
852 | } | 843 | } |
853 | } \ No newline at end of file | 844 | } |
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs index 1753f60..8200a96 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs | |||
@@ -81,24 +81,15 @@ namespace OpenSim.Capabilities.Handlers | |||
81 | // OMG!!! One by one!!! This is fallback code, in case the backend isn't updated | 81 | // OMG!!! One by one!!! This is fallback code, in case the backend isn't updated |
82 | m_log.WarnFormat("[FETCH INVENTORY HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); | 82 | m_log.WarnFormat("[FETCH INVENTORY HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); |
83 | items = new InventoryItemBase[itemsRequested.Count]; | 83 | items = new InventoryItemBase[itemsRequested.Count]; |
84 | InventoryItemBase item = new InventoryItemBase(); | ||
85 | item.Owner = m_agentID; | ||
86 | foreach (UUID id in itemIDs) | 84 | foreach (UUID id in itemIDs) |
87 | { | 85 | items[i++] = m_inventoryService.GetItem(m_agentID, id); |
88 | item.ID = id; | ||
89 | items[i++] = m_inventoryService.GetItem(item); | ||
90 | } | ||
91 | } | 86 | } |
92 | } | 87 | } |
93 | else | 88 | else |
94 | { | 89 | { |
95 | items = new InventoryItemBase[itemsRequested.Count]; | 90 | items = new InventoryItemBase[itemsRequested.Count]; |
96 | InventoryItemBase item = new InventoryItemBase(); | ||
97 | foreach (UUID id in itemIDs) | 91 | foreach (UUID id in itemIDs) |
98 | { | 92 | items[i++] = m_inventoryService.GetItem(UUID.Zero, id); |
99 | item.ID = id; | ||
100 | items[i++] = m_inventoryService.GetItem(item); | ||
101 | } | ||
102 | } | 93 | } |
103 | 94 | ||
104 | foreach (InventoryItemBase item in items) | 95 | foreach (InventoryItemBase item in items) |
@@ -152,4 +143,4 @@ namespace OpenSim.Capabilities.Handlers | |||
152 | return llsdItem; | 143 | return llsdItem; |
153 | } | 144 | } |
154 | } | 145 | } |
155 | } \ No newline at end of file | 146 | } |