mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Allow item links to be deleted even when other deletes and purges are disabled.
If these links are not deleted, then they will build up in the player's inventory until they can no longer log in. Accidental deletion of links due to bugs or other causes is potentially inconvenient but on a par with items being accidentally moved. When a link is deleted, the target of the link is never touched. This is a general solution that accounts for the use of links anywhere in the user's inventory.
This commit is contained in:
@@ -411,12 +411,30 @@ namespace OpenSim.Services.InventoryService
|
||||
public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs)
|
||||
{
|
||||
if (!m_AllowDelete)
|
||||
return false;
|
||||
|
||||
// Just use the ID... *facepalms*
|
||||
//
|
||||
foreach (UUID id in itemIDs)
|
||||
m_Database.DeleteItems("inventoryID", id.ToString());
|
||||
{
|
||||
// We must still allow links and links to folders to be deleted, otherwise they will build up
|
||||
// in the player's inventory until they can no longer log in. Deletions of links due to code bugs or
|
||||
// similar is inconvenient but on a par with accidental movement of items. The original item is never
|
||||
// touched.
|
||||
foreach (UUID id in itemIDs)
|
||||
{
|
||||
if (!m_Database.DeleteItems(
|
||||
new string[] { "inventoryID", "assetType" },
|
||||
new string[] { id.ToString(), ((sbyte)AssetType.Link).ToString() }));
|
||||
{
|
||||
m_Database.DeleteItems(
|
||||
new string[] { "inventoryID", "assetType" },
|
||||
new string[] { id.ToString(), ((sbyte)AssetType.LinkFolder).ToString() });
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just use the ID... *facepalms*
|
||||
//
|
||||
foreach (UUID id in itemIDs)
|
||||
m_Database.DeleteItems("inventoryID", id.ToString());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user