public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
UUID itemID, InventoryItemBase itemUpd)
{
// This one will let people set next perms on items in agent
// inventory. Rut-Roh. Whatever. Make this secure. Yeah.
//
// Passing something to another avatar or a an object will already
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null)
{
if (UUID.Zero == transactionID)
{
item.Name = itemUpd.Name;
item.Description = itemUpd.Description;
item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
item.GroupID = itemUpd.GroupID;
item.GroupOwned = itemUpd.GroupOwned;
item.CreationDate = itemUpd.CreationDate;
// The client sends zero if its newly created?
if (itemUpd.CreationDate == 0)
item.CreationDate = Util.UnixTimeSinceEpoch();
else
item.CreationDate = itemUpd.CreationDate;
// TODO: Check if folder changed and move item
//item.NextPermissions = itemUpd.Folder;
item.InvType = itemUpd.InvType;
item.SalePrice = itemUpd.SalePrice;
item.SaleType = itemUpd.SaleType;
item.Flags = itemUpd.Flags;
InventoryService.UpdateItem(item);
}
else
{
IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
if (agentTransactions != null)
{
agentTransactions.HandleItemUpdateFromTransaction(
remoteClient, transactionID, item);
}
}
}
else
{
m_log.Error(
"[AGENTINVENTORY]: Item ID " + itemID + " not found for an inventory item update.");
}
}