diff --git a/OpenMetaverse/InventoryManager.cs b/OpenMetaverse/InventoryManager.cs index b418a45b..c246f049 100644 --- a/OpenMetaverse/InventoryManager.cs +++ b/OpenMetaverse/InventoryManager.cs @@ -3791,7 +3791,8 @@ namespace OpenMetaverse { if (error is WebException) message = ((HttpWebResponse)((WebException)error).Response).StatusDescription; - else + + if (message == null || message == "None") message = error.Message; } diff --git a/Programs/examples/TestClient/Commands/Inventory/CreateNotecardCommand.cs b/Programs/examples/TestClient/Commands/Inventory/CreateNotecardCommand.cs index 5425a13c..204cfe40 100644 --- a/Programs/examples/TestClient/Commands/Inventory/CreateNotecardCommand.cs +++ b/Programs/examples/TestClient/Commands/Inventory/CreateNotecardCommand.cs @@ -59,13 +59,27 @@ namespace OpenMetaverse.TestClient // Try to fetch the inventory item InventoryItem item = FetchItem(embedItemID); if (item != null) + { notecard.EmbeddedItems = new List { item }; + notecard.BodyText += "xxxx"; + } else + { return "Failed to fetch inventory item " + embedItemID; + } } notecard.Encode(); + if (notecard.EmbeddedItems != null && notecard.EmbeddedItems.Count > 0) + { + // Replace xxxx in the notecard text with a link to the embedded item + notecard.AssetData[notecard.AssetData.Length - 7] = 0xF4; + notecard.AssetData[notecard.AssetData.Length - 6] = 0x80; + notecard.AssetData[notecard.AssetData.Length - 5] = 0x80; + notecard.AssetData[notecard.AssetData.Length - 4] = 0x80; + } + Client.Inventory.RequestCreateItem(Client.Inventory.FindFolderForType(AssetType.Notecard), filename, filename + " created by OpenMetaverse TestClient " + DateTime.Now, AssetType.Notecard, UUID.Random(), InventoryType.Notecard, PermissionMask.All,