diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 0af35c8..2282ee8 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -393,6 +393,10 @@ namespace OpenSim.Services.InventoryService | |||
393 | 393 | ||
394 | public virtual bool UpdateItem(InventoryItemBase item) | 394 | public virtual bool UpdateItem(InventoryItemBase item) |
395 | { | 395 | { |
396 | if (!m_AllowDelete) | ||
397 | if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder) | ||
398 | return false; | ||
399 | |||
396 | return m_Database.StoreItem(ConvertFromOpenSim(item)); | 400 | return m_Database.StoreItem(ConvertFromOpenSim(item)); |
397 | } | 401 | } |
398 | 402 | ||
@@ -411,12 +415,30 @@ namespace OpenSim.Services.InventoryService | |||
411 | public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) | 415 | public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) |
412 | { | 416 | { |
413 | if (!m_AllowDelete) | 417 | if (!m_AllowDelete) |
414 | return false; | 418 | { |
415 | 419 | // We must still allow links and links to folders to be deleted, otherwise they will build up | |
416 | // Just use the ID... *facepalms* | 420 | // in the player's inventory until they can no longer log in. Deletions of links due to code bugs or |
417 | // | 421 | // similar is inconvenient but on a par with accidental movement of items. The original item is never |
418 | foreach (UUID id in itemIDs) | 422 | // touched. |
419 | m_Database.DeleteItems("inventoryID", id.ToString()); | 423 | foreach (UUID id in itemIDs) |
424 | { | ||
425 | if (!m_Database.DeleteItems( | ||
426 | new string[] { "inventoryID", "assetType" }, | ||
427 | new string[] { id.ToString(), ((sbyte)AssetType.Link).ToString() })); | ||
428 | { | ||
429 | m_Database.DeleteItems( | ||
430 | new string[] { "inventoryID", "assetType" }, | ||
431 | new string[] { id.ToString(), ((sbyte)AssetType.LinkFolder).ToString() }); | ||
432 | } | ||
433 | } | ||
434 | } | ||
435 | else | ||
436 | { | ||
437 | // Just use the ID... *facepalms* | ||
438 | // | ||
439 | foreach (UUID id in itemIDs) | ||
440 | m_Database.DeleteItems("inventoryID", id.ToString()); | ||
441 | } | ||
420 | 442 | ||
421 | return true; | 443 | return true; |
422 | } | 444 | } |