diff options
author | Diva Canto | 2011-05-21 14:07:30 -0700 |
---|---|---|
committer | Diva Canto | 2011-05-21 14:07:30 -0700 |
commit | 80457111e0779f296080f4e26c6e56ac1263cba4 (patch) | |
tree | 4a2df3859ad5f71be49a55add550c98a6af04f68 /OpenSim/Services | |
parent | HG Friends working to some extent: friendships offered and accepted correctly... (diff) | |
parent | Get rid of OpenSim.Tests.Common.Setup subpackage in favour of just OpenSim.Te... (diff) | |
download | opensim-SC_OLD-80457111e0779f296080f4e26c6e56ac1263cba4.zip opensim-SC_OLD-80457111e0779f296080f4e26c6e56ac1263cba4.tar.gz opensim-SC_OLD-80457111e0779f296080f4e26c6e56ac1263cba4.tar.bz2 opensim-SC_OLD-80457111e0779f296080f4e26c6e56ac1263cba4.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services')
-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 | } |