/// <summary> /// Delete an item from the user's inventory /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. /// </summary> /// <param name="itemID"></param> /// <returns> /// true on a successful delete or a if the request is queued. /// Returns false on an immediate failure /// </returns> public bool DeleteItem(UUID itemID) { if (m_hasReceivedInventory) { // XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though // really only the item id is required. InventoryItemBase item = RootFolder.FindItem(itemID); if (null == item) { m_log.WarnFormat("[AGENT INVENTORY]: Tried to delete item {0} which does not exist", itemID); return(false); } if (RootFolder.DeleteItem(item.ID)) { return(m_InventoryService.DeleteItem(item)); } } else { AddRequest( new InventoryRequest( Delegate.CreateDelegate(typeof(DeleteItemDelegate), this, "DeleteItem"), new object[] { itemID })); return(true); } return(false); }