diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index b969a8d84b..f34b9c40f7 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -198,7 +198,7 @@ namespace OpenSim.Framework
public delegate void CreateNewInventoryItem(
IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name,
- sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask);
+ sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate);
public delegate void FetchInventoryDescendents(
IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index fa3d9e184f..e8a54bff72 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1762,6 +1762,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
InventoryReply.InventoryData[0].Flags = Item.Flags;
InventoryReply.InventoryData[0].SalePrice = Item.SalePrice;
InventoryReply.InventoryData[0].SaleType = Item.SaleType;
+ InventoryReply.InventoryData[0].CreationDate = Item.CreationDate;
InventoryReply.InventoryData[0].CRC =
Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
@@ -5288,7 +5289,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
createItem.InventoryBlock.InvType,
createItem.InventoryBlock.Type,
createItem.InventoryBlock.WearableType,
- createItem.InventoryBlock.NextOwnerMask);
+ createItem.InventoryBlock.NextOwnerMask,
+ Util.UnixTimeSinceEpoch());
}
break;
case PacketType.FetchInventory:
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 704ca5dc69..5ab7731bfc 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);