From 01a2b0b289933febc95523de02275c9bd573b10e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 2 Jun 2012 04:57:10 +0100 Subject: Fix various issues with http inventory 1) The return messages were being wrongly populated with the names of asset, inventory and sale types when their corresponding integers should have been used instead. 2) Folders with links were including the linked items in the descendents figure, when only the links should be included. 3) Links and linked items in link folders were not being included in the return data, and not in the correct order. Now that these issues have been addressed, outfits and attachments appear to work consistently when HTTP inventory is enabled (as is now the default). --- .../FetchInventory2/FetchInventory2Handler.cs | 30 +++------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs') diff --git a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs index 717a097..c0ca1e1 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory2/FetchInventory2Handler.cs @@ -101,18 +101,8 @@ namespace OpenSim.Capabilities.Handlers llsdItem.item_id = invItem.ID; llsdItem.name = invItem.Name; llsdItem.parent_id = invItem.Folder; - - try - { - llsdItem.type = Utils.AssetTypeToString((AssetType)invItem.AssetType); - llsdItem.inv_type = Utils.InventoryTypeToString((InventoryType)invItem.InvType); - } - catch (Exception e) - { - m_log.ErrorFormat( - "[WEB FETCH INV DESC HANDLER]: Problem setting asset {0} inventory {1} types while converting inventory item {2}: {3}", - invItem.AssetType, invItem.InvType, invItem.Name, e.Message); - } + llsdItem.type = invItem.AssetType; + llsdItem.inv_type = invItem.InvType; llsdItem.permissions = new LLSDPermissions(); llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid; @@ -126,21 +116,7 @@ namespace OpenSim.Capabilities.Handlers llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions; llsdItem.sale_info = new LLSDSaleInfo(); llsdItem.sale_info.sale_price = invItem.SalePrice; - switch (invItem.SaleType) - { - default: - llsdItem.sale_info.sale_type = "not"; - break; - case 1: - llsdItem.sale_info.sale_type = "original"; - break; - case 2: - llsdItem.sale_info.sale_type = "copy"; - break; - case 3: - llsdItem.sale_info.sale_type = "contents"; - break; - } + llsdItem.sale_info.sale_type = invItem.SaleType; return llsdItem; } -- cgit v1.1