aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs73
1 files changed, 43 insertions, 30 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 0e19d96..e92178c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -897,53 +897,66 @@ namespace OpenSim.Region.Environment.Scenes
897 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> 897 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see>
898 /// </summary> 898 /// </summary>
899 /// <param name="remoteClient"></param> 899 /// <param name="remoteClient"></param>
900 /// <param name="itemID"></param> 900 /// <param name="transactionID"></param>
901 /// <param name="folderID"></param> 901 /// <param name="itemInfo"></param>
902 /// <param name="primLocalID"></param> 902 /// <param name="primLocalID"></param>
903 public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, 903 public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID transactionID, TaskInventoryItem itemInfo,
904 uint primLocalID) 904 uint primLocalID)
905 { 905 {
906 LLUUID itemID=itemInfo.ItemID;
907 LLUUID folderID=itemInfo.ParentID;
908
909 // Find the prim we're dealing with
906 SceneObjectPart part = GetSceneObjectPart(primLocalID); 910 SceneObjectPart part = GetSceneObjectPart(primLocalID);
907 911
908 if (part != null) 912 if (part != null)
909 { 913 {
910 LLUUID copyID = LLUUID.Random(); 914 TaskInventoryItem currentItem=part.GetInventoryItem(itemID);
911 if (itemID != LLUUID.Zero) 915 if(currentItem == null)
912 { 916 {
913 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 917 LLUUID copyID = LLUUID.Random();
914 918 if (itemID != LLUUID.Zero)
915 if (userInfo != null && userInfo.RootFolder != null)
916 { 919 {
917 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); 920 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
918 921
919 // Try library 922 if (userInfo != null && userInfo.RootFolder != null)
920 // XXX clumsy, possibly should be one call
921 if (null == item)
922 { 923 {
923 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID); 924 InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
924 }
925 925
926 if (item != null) 926 // Try library
927 { 927 // XXX clumsy, possibly should be one call
928 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID); 928 if (null == item)
929 m_log.InfoFormat(
930 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
931 item.Name, primLocalID, remoteClient.Name);
932 part.GetProperties(remoteClient);
933 if (!ExternalChecks.ExternalChecksBypassPermissions())
934 { 929 {
935 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 930 item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
936 RemoveInventoryItem(remoteClient, itemID); 931 }
932
933 if (item != null)
934 {
935 part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
936 m_log.InfoFormat(
937 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
938 item.Name, primLocalID, remoteClient.Name);
939 part.GetProperties(remoteClient);
940 if (!ExternalChecks.ExternalChecksBypassPermissions())
941 {
942 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
943 RemoveInventoryItem(remoteClient, itemID);
944 }
945 }
946 else
947 {
948 m_log.ErrorFormat(
949 "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!",
950 itemID, remoteClient.Name);
937 } 951 }
938 }
939 else
940 {
941 m_log.ErrorFormat(
942 "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!",
943 itemID, remoteClient.Name);
944 } 952 }
945 } 953 }
946 } 954 }
955 else // Updating existing item with new perms etc
956 {
957 if(part.UpdateInventoryItem(itemInfo))
958 part.GetProperties(remoteClient);
959 }
947 } 960 }
948 else 961 else
949 { 962 {