aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs31
1 files changed, 29 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index cd01a05..523b7f5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -904,11 +904,25 @@ namespace OpenSim.Region.Framework.Scenes
904 } 904 }
905 } 905 }
906 906
907 /// <summary>
908 /// Link an inventory item to an existing item.
909 /// </summary>
910 /// <param name="remoteClient"></param>
911 /// <param name="transActionID"></param>
912 /// <param name="folderID"></param>
913 /// <param name="callbackID"></param>
914 /// <param name="description"></param>
915 /// <param name="name"></param>
916 /// <param name="invType"></param>
917 /// <param name="type">/param>
918 /// <param name="olditemID"></param>
907 private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, 919 private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID,
908 uint callbackID, string description, string name, 920 uint callbackID, string description, string name,
909 sbyte invType, sbyte type, UUID olditemID) 921 sbyte invType, sbyte type, UUID olditemID)
910 { 922 {
911 m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item link {0} in folder {1} pointing to {2}", name, folderID, olditemID); 923 m_log.DebugFormat(
924 "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
925 remoteClient.Name, name, folderID, olditemID);
912 926
913 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) 927 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
914 return; 928 return;
@@ -916,7 +930,20 @@ namespace OpenSim.Region.Framework.Scenes
916 ScenePresence presence; 930 ScenePresence presence;
917 if (TryGetScenePresence(remoteClient.AgentId, out presence)) 931 if (TryGetScenePresence(remoteClient.AgentId, out presence))
918 { 932 {
919// byte[] data = null; 933 bool linkAlreadyExists = false;
934 List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID);
935 foreach (InventoryItemBase item in existingItems)
936 if (item.AssetID == olditemID)
937 linkAlreadyExists = true;
938
939 if (linkAlreadyExists)
940 {
941 m_log.WarnFormat(
942 "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists",
943 remoteClient.Name, name, folderID, olditemID);
944
945 return;
946 }
920 947
921 AssetBase asset = new AssetBase(); 948 AssetBase asset = new AssetBase();
922 asset.FullID = olditemID; 949 asset.FullID = olditemID;