From d0fb5e8c902d5a4e2888fde313c9394617cac6dc Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 13 Jul 2008 18:57:13 +0000 Subject: Mantis#1638. Thank you kindly, Salahzar for a patch that: Addresses an unused field in the asset server but never get filled up. It also makes working the recent items tab in inventory :)))) --- .../Region/Environment/Scenes/Scene.Inventory.cs | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 704ca5d..5ab7731 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -330,6 +330,13 @@ namespace OpenSim.Region.Environment.Scenes //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; @@ -448,6 +455,8 @@ namespace OpenSim.Region.Environment.Scenes itemCopy.SalePrice = item.SalePrice; itemCopy.SaleType = item.SaleType; + itemCopy.CreationDate = item.CreationDate; + recipientUserInfo.AddItem(itemCopy); if (!ExternalChecks.ExternalChecksBypassPermissions()) @@ -532,13 +541,13 @@ namespace OpenSim.Region.Environment.Scenes { CreateNewInventoryItem( remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType, - item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions); + item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, Util.UnixTimeSinceEpoch()); } else { CreateNewInventoryItem( remoteClient, newFolderID, item.Name, item.Flags, callbackID, asset, (sbyte)item.InvType, - item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions); + item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, Util.UnixTimeSinceEpoch()); } } else @@ -634,15 +643,15 @@ namespace OpenSim.Region.Environment.Scenes /// /// private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, - AssetBase asset, sbyte invType, uint nextOwnerMask) + AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) { CreateNewInventoryItem( remoteClient, folderID, name, flags, callbackID, asset, invType, - (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask); + (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, creationDate); } /// - /// Create a new inventory item. + /// Create a new Inventory Item /// /// /// @@ -650,9 +659,10 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// + /// private void CreateNewInventoryItem( IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, - uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask) + uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, int creationDate) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); @@ -674,6 +684,7 @@ namespace OpenSim.Region.Environment.Scenes item.NextPermissions = nextOwnerMask; item.EveryOnePermissions = everyoneMask; item.BasePermissions = baseMask; + item.CreationDate = creationDate; userInfo.AddItem(item); remoteClient.SendInventoryItemCreateUpdate(item); @@ -703,7 +714,7 @@ namespace OpenSim.Region.Environment.Scenes public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte assetType, - byte wearableType, uint nextOwnerMask) + byte wearableType, uint nextOwnerMask, int creationDate) { // m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); @@ -730,7 +741,7 @@ namespace OpenSim.Region.Environment.Scenes AssetBase asset = CreateAsset(name, description, assetType, data); AssetCache.AddAsset(asset); - CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask); + CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); } else { @@ -1664,6 +1675,7 @@ namespace OpenSim.Region.Environment.Scenes } // TODO: add the new fields (Flags, Sale info, etc) + item.CreationDate = Util.UnixTimeSinceEpoch(); userInfo.AddItem(item); if (item.Owner == remoteClient.AgentId) @@ -1817,6 +1829,7 @@ namespace OpenSim.Region.Environment.Scenes item.NextPermissions = objectGroup.RootPart.NextOwnerMask; item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; } + item.CreationDate = Util.UnixTimeSinceEpoch(); userInfo.AddItem(item); remoteClient.SendInventoryItemCreateUpdate(item); -- cgit v1.1