diff options
Diffstat (limited to 'OpenSim')
24 files changed, 205 insertions, 85 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index aec06be..59431bb 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | |||
@@ -851,7 +851,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
851 | 851 | ||
852 | // Delete the old item | 852 | // Delete the old item |
853 | 853 | ||
854 | Rest.InventoryServices.DeleteItem(uri); | 854 | List<UUID> uuids = new List<UUID>(); |
855 | uuids.Add(uri.ID); | ||
856 | Rest.InventoryServices.DeleteItems(uri.Owner, uuids); | ||
855 | 857 | ||
856 | // Add the new item to the inventory | 858 | // Add the new item to the inventory |
857 | 859 | ||
@@ -927,7 +929,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
927 | InventoryItemBase item = (InventoryItemBase) InventoryNode; | 929 | InventoryItemBase item = (InventoryItemBase) InventoryNode; |
928 | Rest.Log.DebugFormat("{0} {1}: Item {2} will be deleted", | 930 | Rest.Log.DebugFormat("{0} {1}: Item {2} will be deleted", |
929 | MsgId, rdata.method, rdata.path); | 931 | MsgId, rdata.method, rdata.path); |
930 | Rest.InventoryServices.DeleteItem(item); | 932 | List<UUID> uuids = new List<UUID>(); |
933 | uuids.Add(item.ID); | ||
934 | Rest.InventoryServices.DeleteItems(item.Owner, uuids); | ||
931 | rdata.appendStatus(String.Format("<p>Deleted item {0} UUID {1} <p>", item.Name, item.ID)); | 935 | rdata.appendStatus(String.Format("<p>Deleted item {0} UUID {1} <p>", item.Name, item.ID)); |
932 | } | 936 | } |
933 | 937 | ||
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index ca641d0..238810a 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -653,7 +653,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
653 | 653 | ||
654 | if (RootFolder.DeleteItem(item.ID)) | 654 | if (RootFolder.DeleteItem(item.ID)) |
655 | { | 655 | { |
656 | return m_InventoryService.DeleteItem(item); | 656 | List<UUID> uuids = new List<UUID>(); |
657 | uuids.Add(itemID); | ||
658 | return m_InventoryService.DeleteItems(this.UserProfile.ID, uuids); | ||
657 | } | 659 | } |
658 | } | 660 | } |
659 | else | 661 | else |
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index 22dcef9..d5d4d1e 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs | |||
@@ -547,7 +547,7 @@ namespace OpenSim.Framework.Communications.Tests | |||
547 | return false; | 547 | return false; |
548 | } | 548 | } |
549 | 549 | ||
550 | public bool DeleteItem(InventoryItemBase item) | 550 | public bool DeleteItems(UUID owner, List<UUID> items) |
551 | { | 551 | { |
552 | return false; | 552 | return false; |
553 | } | 553 | } |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index e451dd8..ca37a5b 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -257,7 +257,7 @@ namespace OpenSim.Framework | |||
257 | IClientAPI remoteClient, UUID folderID, UUID itemID, int length, string newName); | 257 | IClientAPI remoteClient, UUID folderID, UUID itemID, int length, string newName); |
258 | 258 | ||
259 | public delegate void RemoveInventoryItem( | 259 | public delegate void RemoveInventoryItem( |
260 | IClientAPI remoteClient, UUID itemID); | 260 | IClientAPI remoteClient, List<UUID> itemIDs); |
261 | 261 | ||
262 | public delegate void RemoveInventoryFolder( | 262 | public delegate void RemoveInventoryFolder( |
263 | IClientAPI remoteClient, UUID folderID); | 263 | IClientAPI remoteClient, UUID folderID); |
diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index 05f11a4..1869d48 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs | |||
@@ -78,6 +78,12 @@ namespace OpenSim.Framework | |||
78 | ID = id; | 78 | ID = id; |
79 | } | 79 | } |
80 | 80 | ||
81 | public InventoryFolderBase(UUID id, UUID owner) | ||
82 | { | ||
83 | ID = id; | ||
84 | Owner = owner; | ||
85 | } | ||
86 | |||
81 | public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version) | 87 | public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version) |
82 | { | 88 | { |
83 | ID = id; | 89 | ID = id; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 06bea3d..e2fb659 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -6633,9 +6633,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6633 | } | 6633 | } |
6634 | else // Agent | 6634 | else // Agent |
6635 | { | 6635 | { |
6636 | //InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(itemID); | ||
6637 | IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); | 6636 | IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); |
6638 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(itemID)); | 6637 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); |
6638 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
6639 | if (assetRequestItem == null) | 6639 | if (assetRequestItem == null) |
6640 | { | 6640 | { |
6641 | assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); | 6641 | assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); |
@@ -7053,14 +7053,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7053 | if (OnRemoveInventoryItem != null) | 7053 | if (OnRemoveInventoryItem != null) |
7054 | { | 7054 | { |
7055 | handlerRemoveInventoryItem = null; | 7055 | handlerRemoveInventoryItem = null; |
7056 | List<UUID> uuids = new List<UUID>(); | ||
7056 | foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) | 7057 | foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) |
7057 | { | 7058 | { |
7058 | handlerRemoveInventoryItem = OnRemoveInventoryItem; | 7059 | uuids.Add(datablock.ItemID); |
7059 | if (handlerRemoveInventoryItem != null) | ||
7060 | { | ||
7061 | handlerRemoveInventoryItem(this, datablock.ItemID); | ||
7062 | } | ||
7063 | } | 7060 | } |
7061 | handlerRemoveInventoryItem = OnRemoveInventoryItem; | ||
7062 | if (handlerRemoveInventoryItem != null) | ||
7063 | { | ||
7064 | handlerRemoveInventoryItem(this, uuids); | ||
7065 | } | ||
7066 | |||
7064 | } | 7067 | } |
7065 | break; | 7068 | break; |
7066 | case PacketType.RemoveInventoryFolder: | 7069 | case PacketType.RemoveInventoryFolder: |
@@ -7116,13 +7119,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7116 | if (OnRemoveInventoryItem != null) | 7119 | if (OnRemoveInventoryItem != null) |
7117 | { | 7120 | { |
7118 | handlerRemoveInventoryItem = null; | 7121 | handlerRemoveInventoryItem = null; |
7122 | List<UUID> uuids = new List<UUID>(); | ||
7119 | foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData) | 7123 | foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData) |
7120 | { | 7124 | { |
7121 | handlerRemoveInventoryItem = OnRemoveInventoryItem; | 7125 | uuids.Add(datablock.ItemID); |
7122 | if (handlerRemoveInventoryItem != null) | 7126 | } |
7123 | { | 7127 | handlerRemoveInventoryItem = OnRemoveInventoryItem; |
7124 | handlerRemoveInventoryItem(this, datablock.ItemID); | 7128 | if (handlerRemoveInventoryItem != null) |
7125 | } | 7129 | { |
7130 | handlerRemoveInventoryItem(this, uuids); | ||
7126 | } | 7131 | } |
7127 | } | 7132 | } |
7128 | break; | 7133 | break; |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 582beee..35c59aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -130,7 +130,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
130 | } | 130 | } |
131 | else | 131 | else |
132 | { | 132 | { |
133 | InventoryItemBase baseItem = invService.GetItem(new InventoryItemBase(appearance.Wearables[i].ItemID)); | 133 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); |
134 | baseItem = invService.GetItem(baseItem); | ||
134 | 135 | ||
135 | if (baseItem != null) | 136 | if (baseItem != null) |
136 | { | 137 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index a68db1b..ff12361 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -65,7 +65,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
65 | { | 65 | { |
66 | IInventoryService invService = m_scene.InventoryService; | 66 | IInventoryService invService = m_scene.InventoryService; |
67 | 67 | ||
68 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); | 68 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); |
69 | item = invService.GetItem(item); | ||
69 | if (item != null) | 70 | if (item != null) |
70 | { | 71 | { |
71 | item.Flags = 1; | 72 | item.Flags = 1; |
@@ -80,7 +81,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
80 | { | 81 | { |
81 | IInventoryService invService = m_scene.InventoryService; | 82 | IInventoryService invService = m_scene.InventoryService; |
82 | 83 | ||
83 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); | 84 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); |
85 | item = invService.GetItem(item); | ||
84 | if (item != null) | 86 | if (item != null) |
85 | { | 87 | { |
86 | item.Flags = 0; | 88 | item.Flags = 0; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 5315c11..5afbf68 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -257,8 +257,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
257 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); | 257 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); |
258 | 258 | ||
259 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 259 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
260 | 260 | ||
261 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(inventoryEntityID)); | 261 | InventoryItemBase item = new InventoryItemBase(inventoryEntityID, client.AgentId); |
262 | item = invService.GetItem(item); | ||
262 | InventoryFolderBase folder = null; | 263 | InventoryFolderBase folder = null; |
263 | 264 | ||
264 | if (item != null && trashFolder != null) | 265 | if (item != null && trashFolder != null) |
@@ -266,12 +267,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
266 | item.Folder = trashFolder.ID; | 267 | item.Folder = trashFolder.ID; |
267 | 268 | ||
268 | // Diva comment: can't we just update this item??? | 269 | // Diva comment: can't we just update this item??? |
269 | invService.DeleteItem(item); | 270 | List<UUID> uuids = new List<UUID>(); |
271 | uuids.Add(item.ID); | ||
272 | invService.DeleteItems(item.Owner, uuids); | ||
270 | scene.AddInventoryItem(client, item); | 273 | scene.AddInventoryItem(client, item); |
271 | } | 274 | } |
272 | else | 275 | else |
273 | { | 276 | { |
274 | folder = invService.GetFolder(new InventoryFolderBase(inventoryEntityID)); | 277 | folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); |
278 | folder = invService.GetFolder(folder); | ||
275 | 279 | ||
276 | if (folder != null & trashFolder != null) | 280 | if (folder != null & trashFolder != null) |
277 | { | 281 | { |
@@ -451,10 +455,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
451 | else | 455 | else |
452 | { | 456 | { |
453 | UUID itemID = new UUID(msg.binaryBucket, 1); | 457 | UUID itemID = new UUID(msg.binaryBucket, 1); |
454 | InventoryItemBase item = new InventoryItemBase(); | 458 | InventoryItemBase item = new InventoryItemBase(itemID, user.ControllingClient.AgentId); |
455 | |||
456 | item.ID = itemID; | ||
457 | item.Owner = user.ControllingClient.AgentId; | ||
458 | 459 | ||
459 | // Fetch from service | 460 | // Fetch from service |
460 | // | 461 | // |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index ef5ffe1..d1ae3e4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
186 | /// </summary> | 186 | /// </summary> |
187 | /// <param name="item"></param> | 187 | /// <param name="item"></param> |
188 | /// <returns>true if the item was successfully deleted</returns> | 188 | /// <returns>true if the item was successfully deleted</returns> |
189 | public abstract bool DeleteItem(InventoryItemBase item); | 189 | public abstract bool DeleteItems(UUID ownerID, List<UUID> itemIDs); |
190 | 190 | ||
191 | public abstract InventoryItemBase GetItem(InventoryItemBase item); | 191 | public abstract InventoryItemBase GetItem(InventoryItemBase item); |
192 | 192 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index dd451ef..6a1f2d5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -290,7 +290,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
290 | 290 | ||
291 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 291 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
292 | { | 292 | { |
293 | return new List<InventoryItemBase>(); | 293 | if (IsLocalGridUser(userID)) |
294 | return m_GridService.GetFolderItems(userID, folderID); | ||
295 | else | ||
296 | { | ||
297 | UUID sessionID = GetSessionID(userID); | ||
298 | string uri = GetUserInventoryURI(userID) + "/" + userID; | ||
299 | return m_HGService.GetFolderItems(uri, folderID, sessionID); | ||
300 | } | ||
294 | } | 301 | } |
295 | 302 | ||
296 | public override bool AddFolder(InventoryFolderBase folder) | 303 | public override bool AddFolder(InventoryFolderBase folder) |
@@ -386,18 +393,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
386 | } | 393 | } |
387 | } | 394 | } |
388 | 395 | ||
389 | public override bool DeleteItem(InventoryItemBase item) | 396 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
390 | { | 397 | { |
391 | if (item == null) | 398 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); |
399 | |||
400 | if (itemIDs == null) | ||
392 | return false; | 401 | return false; |
402 | if (itemIDs.Count == 0) | ||
403 | return true; | ||
393 | 404 | ||
394 | if (IsLocalGridUser(item.Owner)) | 405 | if (IsLocalGridUser(ownerID)) |
395 | return m_GridService.DeleteItem(item); | 406 | return m_GridService.DeleteItems(ownerID, itemIDs); |
396 | else | 407 | else |
397 | { | 408 | { |
398 | UUID sessionID = GetSessionID(item.Owner); | 409 | UUID sessionID = GetSessionID(ownerID); |
399 | string uri = GetUserInventoryURI(item.Owner) + "/" + item.Owner.ToString(); | 410 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); |
400 | return m_HGService.DeleteItem(uri, item, sessionID); | 411 | return m_HGService.DeleteItems(uri, itemIDs, sessionID); |
401 | } | 412 | } |
402 | } | 413 | } |
403 | 414 | ||
@@ -483,12 +494,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
483 | string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); | 494 | string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); |
484 | string uri = m_LocalGridInventoryURI.TrimEnd('/'); | 495 | string uri = m_LocalGridInventoryURI.TrimEnd('/'); |
485 | 496 | ||
486 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, comparing {0} to {1}.", userInventoryServerURI, uri); | ||
487 | |||
488 | if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) | 497 | if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) |
489 | { | 498 | { |
490 | return true; | 499 | return true; |
491 | } | 500 | } |
501 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user {0} is foreign({1} - {2})", userID, userInventoryServerURI, uri); | ||
492 | return false; | 502 | return false; |
493 | } | 503 | } |
494 | 504 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 2fbc5fe..b2640af 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -294,9 +294,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
294 | /// </summary> | 294 | /// </summary> |
295 | /// <param name="item"></param> | 295 | /// <param name="item"></param> |
296 | /// <returns>true if the item was successfully deleted</returns> | 296 | /// <returns>true if the item was successfully deleted</returns> |
297 | public override bool DeleteItem(InventoryItemBase item) | 297 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
298 | { | 298 | { |
299 | return m_InventoryService.DeleteItem(item); | 299 | return m_InventoryService.DeleteItems(ownerID, itemIDs); |
300 | } | 300 | } |
301 | 301 | ||
302 | public override InventoryItemBase GetItem(InventoryItemBase item) | 302 | public override InventoryItemBase GetItem(InventoryItemBase item) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index bef716b..012f0e3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -212,7 +212,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
212 | 212 | ||
213 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 213 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
214 | { | 214 | { |
215 | return new List<InventoryItemBase>(); | 215 | UUID sessionID = GetSessionID(userID); |
216 | return m_RemoteConnector.GetFolderItems(userID.ToString(), folderID, sessionID); | ||
216 | } | 217 | } |
217 | 218 | ||
218 | public override bool AddFolder(InventoryFolderBase folder) | 219 | public override bool AddFolder(InventoryFolderBase folder) |
@@ -272,13 +273,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
272 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); | 273 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); |
273 | } | 274 | } |
274 | 275 | ||
275 | public override bool DeleteItem(InventoryItemBase item) | 276 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
276 | { | 277 | { |
277 | if (item == null) | 278 | if (itemIDs == null) |
278 | return false; | 279 | return false; |
280 | if (itemIDs.Count == 0) | ||
281 | return true; | ||
279 | 282 | ||
280 | UUID sessionID = GetSessionID(item.Owner); | 283 | UUID sessionID = GetSessionID(ownerID); |
281 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); | 284 | return m_RemoteConnector.DeleteItems(ownerID.ToString(), itemIDs, sessionID); |
282 | } | 285 | } |
283 | 286 | ||
284 | public override InventoryItemBase GetItem(InventoryItemBase item) | 287 | public override InventoryItemBase GetItem(InventoryItemBase item) |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 9c71b41..f360577 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -966,7 +966,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
966 | if (objectID == UUID.Zero) // User inventory | 966 | if (objectID == UUID.Zero) // User inventory |
967 | { | 967 | { |
968 | IInventoryService invService = m_scene.InventoryService; | 968 | IInventoryService invService = m_scene.InventoryService; |
969 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); | 969 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
970 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
970 | if (assetRequestItem == null) // Library item | 971 | if (assetRequestItem == null) // Library item |
971 | { | 972 | { |
972 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 973 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |
@@ -1385,7 +1386,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1385 | if (objectID == UUID.Zero) // User inventory | 1386 | if (objectID == UUID.Zero) // User inventory |
1386 | { | 1387 | { |
1387 | IInventoryService invService = m_scene.InventoryService; | 1388 | IInventoryService invService = m_scene.InventoryService; |
1388 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(script)); | 1389 | InventoryItemBase assetRequestItem = new InventoryItemBase(script, user); |
1390 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1389 | if (assetRequestItem == null) // Library item | 1391 | if (assetRequestItem == null) // Library item |
1390 | { | 1392 | { |
1391 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); | 1393 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); |
@@ -1479,7 +1481,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1479 | if (objectID == UUID.Zero) // User inventory | 1481 | if (objectID == UUID.Zero) // User inventory |
1480 | { | 1482 | { |
1481 | IInventoryService invService = m_scene.InventoryService; | 1483 | IInventoryService invService = m_scene.InventoryService; |
1482 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); | 1484 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
1485 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1483 | if (assetRequestItem == null) // Library item | 1486 | if (assetRequestItem == null) // Library item |
1484 | { | 1487 | { |
1485 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 1488 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 46777e1..5e2eb73 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -140,7 +140,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | /// <returns></returns> | 140 | /// <returns></returns> |
141 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 141 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
142 | { | 142 | { |
143 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 143 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
144 | item = InventoryService.GetItem(item); | ||
144 | 145 | ||
145 | if (item != null) | 146 | if (item != null) |
146 | { | 147 | { |
@@ -315,7 +316,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
315 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, | 316 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, |
316 | UUID itemID, InventoryItemBase itemUpd) | 317 | UUID itemID, InventoryItemBase itemUpd) |
317 | { | 318 | { |
318 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 319 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
320 | item = InventoryService.GetItem(item); | ||
319 | 321 | ||
320 | if (item != null) | 322 | if (item != null) |
321 | { | 323 | { |
@@ -408,7 +410,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
408 | { | 410 | { |
409 | Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); | 411 | Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); |
410 | 412 | ||
411 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemId)); | 413 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); |
414 | item = InventoryService.GetItem(item); | ||
412 | 415 | ||
413 | if ((item != null) && (item.Owner == senderId)) | 416 | if ((item != null) && (item.Owner == senderId)) |
414 | { | 417 | { |
@@ -474,7 +477,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
474 | if (!Permissions.BypassPermissions()) | 477 | if (!Permissions.BypassPermissions()) |
475 | { | 478 | { |
476 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 479 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
477 | InventoryService.DeleteItem(new InventoryItemBase(itemId)); | 480 | { |
481 | List<UUID> items = new List<UUID>(); | ||
482 | items.Add(itemId); | ||
483 | InventoryService.DeleteItems(senderId, items); | ||
484 | } | ||
478 | } | 485 | } |
479 | 486 | ||
480 | return itemCopy; | 487 | return itemCopy; |
@@ -558,7 +565,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
558 | 565 | ||
559 | if (item == null) | 566 | if (item == null) |
560 | { | 567 | { |
561 | item = InventoryService.GetItem(new InventoryItemBase(oldItemID)); | 568 | item = new InventoryItemBase(oldItemID, remoteClient.AgentId); |
569 | item = InventoryService.GetItem(item); | ||
562 | 570 | ||
563 | if (item == null) | 571 | if (item == null) |
564 | { | 572 | { |
@@ -636,7 +644,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
636 | m_log.DebugFormat( | 644 | m_log.DebugFormat( |
637 | "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); | 645 | "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); |
638 | 646 | ||
639 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 647 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
648 | item = InventoryService.GetItem(item); | ||
640 | 649 | ||
641 | if (item != null) | 650 | if (item != null) |
642 | { | 651 | { |
@@ -647,7 +656,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
647 | item.Folder = folderID; | 656 | item.Folder = folderID; |
648 | 657 | ||
649 | // Diva comment: can't we just update? | 658 | // Diva comment: can't we just update? |
650 | InventoryService.DeleteItem(item); | 659 | List<UUID> uuids = new List<UUID>(); |
660 | uuids.Add(item.ID); | ||
661 | InventoryService.DeleteItems(item.Owner, uuids); | ||
651 | 662 | ||
652 | AddInventoryItem(remoteClient, item); | 663 | AddInventoryItem(remoteClient, item); |
653 | } | 664 | } |
@@ -794,9 +805,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
794 | /// </summary> | 805 | /// </summary> |
795 | /// <param name="remoteClient"></param> | 806 | /// <param name="remoteClient"></param> |
796 | /// <param name="itemID"></param> | 807 | /// <param name="itemID"></param> |
797 | private void RemoveInventoryItem(IClientAPI remoteClient, UUID itemID) | 808 | private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs) |
798 | { | 809 | { |
799 | InventoryService.DeleteItem(new InventoryItemBase(itemID)); | 810 | //m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId); |
811 | InventoryService.DeleteItems(remoteClient.AgentId, itemIDs); | ||
800 | } | 812 | } |
801 | 813 | ||
802 | /// <summary> | 814 | /// <summary> |
@@ -1224,7 +1236,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1224 | UUID copyID = UUID.Random(); | 1236 | UUID copyID = UUID.Random(); |
1225 | if (itemID != UUID.Zero) | 1237 | if (itemID != UUID.Zero) |
1226 | { | 1238 | { |
1227 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1239 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1240 | item = InventoryService.GetItem(item); | ||
1228 | 1241 | ||
1229 | // Try library | 1242 | // Try library |
1230 | if (null == item) | 1243 | if (null == item) |
@@ -1242,7 +1255,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1242 | if (!Permissions.BypassPermissions()) | 1255 | if (!Permissions.BypassPermissions()) |
1243 | { | 1256 | { |
1244 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1257 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1245 | RemoveInventoryItem(remoteClient, itemID); | 1258 | { |
1259 | List<UUID> uuids = new List<UUID>(); | ||
1260 | uuids.Add(itemID); | ||
1261 | RemoveInventoryItem(remoteClient, uuids); | ||
1262 | } | ||
1246 | } | 1263 | } |
1247 | } | 1264 | } |
1248 | else | 1265 | else |
@@ -1287,7 +1304,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1287 | 1304 | ||
1288 | if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory | 1305 | if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory |
1289 | { | 1306 | { |
1290 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1307 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1308 | item = InventoryService.GetItem(item); | ||
1291 | 1309 | ||
1292 | // Try library | 1310 | // Try library |
1293 | // XXX clumsy, possibly should be one call | 1311 | // XXX clumsy, possibly should be one call |
@@ -1672,7 +1690,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1672 | 1690 | ||
1673 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1691 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1674 | { | 1692 | { |
1675 | item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID); | 1693 | item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID); |
1676 | item = InventoryService.GetItem(item); | 1694 | item = InventoryService.GetItem(item); |
1677 | 1695 | ||
1678 | //item = userInfo.RootFolder.FindItem( | 1696 | //item = userInfo.RootFolder.FindItem( |
@@ -1834,7 +1852,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1834 | 1852 | ||
1835 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); | 1853 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); |
1836 | 1854 | ||
1837 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1855 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1856 | item = InventoryService.GetItem(item); | ||
1838 | 1857 | ||
1839 | if (item != null) | 1858 | if (item != null) |
1840 | { | 1859 | { |
@@ -1984,7 +2003,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1984 | BypassRayCast, bRayEndIsIntersection,true,scale, false); | 2003 | BypassRayCast, bRayEndIsIntersection,true,scale, false); |
1985 | 2004 | ||
1986 | // Rez object | 2005 | // Rez object |
1987 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 2006 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2007 | item = InventoryService.GetItem(item); | ||
1988 | 2008 | ||
1989 | if (item != null) | 2009 | if (item != null) |
1990 | { | 2010 | { |
@@ -2135,7 +2155,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2135 | // copy ones will be lost, so avoid it | 2155 | // copy ones will be lost, so avoid it |
2136 | // | 2156 | // |
2137 | if (!attachment) | 2157 | if (!attachment) |
2138 | InventoryService.DeleteItem(item); | 2158 | { |
2159 | List<UUID> uuids = new List<UUID>(); | ||
2160 | uuids.Add(item.ID); | ||
2161 | InventoryService.DeleteItems(item.Owner, uuids); | ||
2162 | } | ||
2139 | } | 2163 | } |
2140 | } | 2164 | } |
2141 | 2165 | ||
@@ -2309,7 +2333,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2309 | ScenePresence presence; | 2333 | ScenePresence presence; |
2310 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2334 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2311 | { | 2335 | { |
2312 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID, remoteClient.AgentId)); | 2336 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2337 | item = InventoryService.GetItem(item); | ||
2313 | 2338 | ||
2314 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2339 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2315 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); | 2340 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); |
@@ -2360,7 +2385,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2360 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2385 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2361 | { | 2386 | { |
2362 | // XXYY!! | 2387 | // XXYY!! |
2363 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 2388 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2389 | item = InventoryService.GetItem(item); | ||
2364 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2390 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2365 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); | 2391 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); |
2366 | if (ava != null) | 2392 | if (ava != null) |
@@ -2393,7 +2419,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2393 | } | 2419 | } |
2394 | part.ParentGroup.DetachToGround(); | 2420 | part.ParentGroup.DetachToGround(); |
2395 | 2421 | ||
2396 | InventoryService.DeleteItem(new InventoryItemBase(inventoryID)); | 2422 | List<UUID> uuids = new List<UUID>(); |
2423 | uuids.Add(inventoryID); | ||
2424 | InventoryService.DeleteItems(remoteClient.AgentId, uuids); | ||
2397 | remoteClient.SendRemoveInventoryItem(inventoryID); | 2425 | remoteClient.SendRemoveInventoryItem(inventoryID); |
2398 | } | 2426 | } |
2399 | SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); | 2427 | SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index fde922f..a2414e5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -404,7 +404,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
404 | return; | 404 | return; |
405 | } | 405 | } |
406 | 406 | ||
407 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 407 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
408 | item = InventoryService.GetItem(item); | ||
408 | 409 | ||
409 | if (item != null) | 410 | if (item != null) |
410 | { | 411 | { |
@@ -559,7 +560,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
559 | 560 | ||
560 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) | 561 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) |
561 | { | 562 | { |
562 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | 563 | InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); |
563 | 564 | ||
564 | if (InventoryService.PurgeFolder(folder)) | 565 | if (InventoryService.PurgeFolder(folder)) |
565 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); | 566 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); |
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index 30b3cae..6cfc7df 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | |||
@@ -105,8 +105,8 @@ namespace OpenSim.Server.Handlers.Inventory | |||
105 | "POST", "/PurgeFolder/", m_InventoryService.PurgeFolder, CheckAuthSession)); | 105 | "POST", "/PurgeFolder/", m_InventoryService.PurgeFolder, CheckAuthSession)); |
106 | 106 | ||
107 | m_httpServer.AddStreamHandler( | 107 | m_httpServer.AddStreamHandler( |
108 | new RestDeserialiseSecureHandler<InventoryItemBase, bool>( | 108 | new RestDeserialiseSecureHandler<List<Guid>, bool>( |
109 | "POST", "/DeleteItem/", m_InventoryService.DeleteItem, CheckAuthSession)); | 109 | "POST", "/DeleteItem/", DeleteItems, CheckAuthSession)); |
110 | 110 | ||
111 | m_httpServer.AddStreamHandler( | 111 | m_httpServer.AddStreamHandler( |
112 | new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( | 112 | new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( |
@@ -247,6 +247,15 @@ namespace OpenSim.Server.Handlers.Inventory | |||
247 | return m_InventoryService.GetAssetPermissions(item.Owner, item.AssetID); | 247 | return m_InventoryService.GetAssetPermissions(item.Owner, item.AssetID); |
248 | } | 248 | } |
249 | 249 | ||
250 | public bool DeleteItems(List<Guid> items) | ||
251 | { | ||
252 | List<UUID> uuids = new List<UUID>(); | ||
253 | foreach (Guid g in items) | ||
254 | uuids.Add(new UUID(g)); | ||
255 | // oops we lost the user info here. Bad bad handlers | ||
256 | return m_InventoryService.DeleteItems(UUID.Zero, uuids); | ||
257 | } | ||
258 | |||
250 | #endregion | 259 | #endregion |
251 | 260 | ||
252 | /// <summary> | 261 | /// <summary> |
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs index 94b4ad9..00b74b5 100644 --- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs | |||
@@ -214,6 +214,19 @@ namespace OpenSim.Services.Connectors.Inventory | |||
214 | return false; | 214 | return false; |
215 | } | 215 | } |
216 | 216 | ||
217 | public List<InventoryItemBase> GetFolderItems(string id, UUID folderID, UUID sessionID) | ||
218 | { | ||
219 | string url = string.Empty; | ||
220 | string userID = string.Empty; | ||
221 | |||
222 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
223 | { | ||
224 | ISessionAuthInventoryService connector = GetConnector(url); | ||
225 | return connector.GetFolderItems(userID, folderID, sessionID); | ||
226 | } | ||
227 | return new List<InventoryItemBase>(); | ||
228 | } | ||
229 | |||
217 | public bool AddItem(string id, InventoryItemBase item, UUID sessionID) | 230 | public bool AddItem(string id, InventoryItemBase item, UUID sessionID) |
218 | { | 231 | { |
219 | string url = string.Empty; | 232 | string url = string.Empty; |
@@ -240,7 +253,7 @@ namespace OpenSim.Services.Connectors.Inventory | |||
240 | return false; | 253 | return false; |
241 | } | 254 | } |
242 | 255 | ||
243 | public bool DeleteItem(string id, InventoryItemBase item, UUID sessionID) | 256 | public bool DeleteItems(string id, List<UUID> itemIDs, UUID sessionID) |
244 | { | 257 | { |
245 | string url = string.Empty; | 258 | string url = string.Empty; |
246 | string userID = string.Empty; | 259 | string userID = string.Empty; |
@@ -248,7 +261,7 @@ namespace OpenSim.Services.Connectors.Inventory | |||
248 | if (StringToUrlAndUserID(id, out url, out userID)) | 261 | if (StringToUrlAndUserID(id, out url, out userID)) |
249 | { | 262 | { |
250 | ISessionAuthInventoryService connector = GetConnector(url); | 263 | ISessionAuthInventoryService connector = GetConnector(url); |
251 | return connector.UpdateItem(userID, item, sessionID); | 264 | return connector.DeleteItems(userID, itemIDs, sessionID); |
252 | } | 265 | } |
253 | return false; | 266 | return false; |
254 | } | 267 | } |
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs index f50bcf5..e4e713c 100644 --- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs +++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs | |||
@@ -96,6 +96,13 @@ namespace OpenSim.Services.Connectors | |||
96 | bool PurgeFolder(string userID, InventoryFolderBase folder, UUID session_id); | 96 | bool PurgeFolder(string userID, InventoryFolderBase folder, UUID session_id); |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Get items from a folder. | ||
100 | /// </summary> | ||
101 | /// <param name="folder"></param> | ||
102 | /// <returns>true if the folder was successfully purged</returns> | ||
103 | List<InventoryItemBase> GetFolderItems(string userID, UUID folderID, UUID session_id); | ||
104 | |||
105 | /// <summary> | ||
99 | /// Add a new item to the user's inventory | 106 | /// Add a new item to the user's inventory |
100 | /// </summary> | 107 | /// </summary> |
101 | /// <param name="item"></param> | 108 | /// <param name="item"></param> |
@@ -114,7 +121,7 @@ namespace OpenSim.Services.Connectors | |||
114 | /// </summary> | 121 | /// </summary> |
115 | /// <param name="item"></param> | 122 | /// <param name="item"></param> |
116 | /// <returns>true if the item was successfully deleted</returns> | 123 | /// <returns>true if the item was successfully deleted</returns> |
117 | bool DeleteItem(string userID, InventoryItemBase item, UUID session_id); | 124 | bool DeleteItems(string userID, List<UUID> itemIDs, UUID session_id); |
118 | 125 | ||
119 | InventoryItemBase QueryItem(string userID, InventoryItemBase item, UUID session_id); | 126 | InventoryItemBase QueryItem(string userID, InventoryItemBase item, UUID session_id); |
120 | 127 | ||
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index 5d94eac..9b2e331 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -334,6 +334,23 @@ namespace OpenSim.Services.Connectors | |||
334 | return false; | 334 | return false; |
335 | } | 335 | } |
336 | 336 | ||
337 | public List<InventoryItemBase> GetFolderItems(string userID, UUID folderID, UUID sessionID) | ||
338 | { | ||
339 | try | ||
340 | { | ||
341 | InventoryFolderBase folder = new InventoryFolderBase(folderID, new UUID(userID)); | ||
342 | return SynchronousRestSessionObjectPoster<InventoryFolderBase, List<InventoryItemBase>>.BeginPostObject( | ||
343 | "POST", m_ServerURI + "/GetItems/", folder, sessionID.ToString(), userID); | ||
344 | } | ||
345 | catch (Exception e) | ||
346 | { | ||
347 | m_log.ErrorFormat("[INVENTORY CONNECTOR]: Get folder items operation failed, {0} {1}", | ||
348 | e.Source, e.Message); | ||
349 | } | ||
350 | |||
351 | return null; | ||
352 | } | ||
353 | |||
337 | public bool AddItem(string userID, InventoryItemBase item, UUID sessionID) | 354 | public bool AddItem(string userID, InventoryItemBase item, UUID sessionID) |
338 | { | 355 | { |
339 | try | 356 | try |
@@ -366,12 +383,15 @@ namespace OpenSim.Services.Connectors | |||
366 | return false; | 383 | return false; |
367 | } | 384 | } |
368 | 385 | ||
369 | public bool DeleteItem(string userID, InventoryItemBase item, UUID sessionID) | 386 | public bool DeleteItems(string userID, List<UUID> items, UUID sessionID) |
370 | { | 387 | { |
371 | try | 388 | try |
372 | { | 389 | { |
373 | return SynchronousRestSessionObjectPoster<InventoryItemBase, bool>.BeginPostObject( | 390 | List<Guid> guids = new List<Guid>(); |
374 | "POST", m_ServerURI + "/DeleteItem/", item, sessionID.ToString(), item.Owner.ToString()); | 391 | foreach (UUID u in items) |
392 | guids.Add(u.Guid); | ||
393 | return SynchronousRestSessionObjectPoster<List<Guid>, bool>.BeginPostObject( | ||
394 | "POST", m_ServerURI + "/DeleteItem/", guids, sessionID.ToString(), userID); | ||
375 | } | 395 | } |
376 | catch (Exception e) | 396 | catch (Exception e) |
377 | { | 397 | { |
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs index 5cbd307..3bbf129 100644 --- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs | |||
@@ -151,7 +151,7 @@ namespace OpenSim.Services.Connectors | |||
151 | return false; | 151 | return false; |
152 | } | 152 | } |
153 | 153 | ||
154 | public bool DeleteItem(InventoryItemBase item) | 154 | public bool DeleteItems(UUID owner, List<UUID> itemIDs) |
155 | { | 155 | { |
156 | return false; | 156 | return false; |
157 | } | 157 | } |
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index a89a238..6409b57 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs | |||
@@ -147,7 +147,8 @@ namespace OpenSim.Services.Interfaces | |||
147 | /// </summary> | 147 | /// </summary> |
148 | /// <param name="item"></param> | 148 | /// <param name="item"></param> |
149 | /// <returns>true if the item was successfully deleted</returns> | 149 | /// <returns>true if the item was successfully deleted</returns> |
150 | bool DeleteItem(InventoryItemBase item); | 150 | //bool DeleteItem(InventoryItemBase item); |
151 | bool DeleteItems(UUID userID, List<UUID> itemIDs); | ||
151 | 152 | ||
152 | /// <summary> | 153 | /// <summary> |
153 | /// Get an item, given by its UUID | 154 | /// Get an item, given by its UUID |
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 65c2d96..69b1b28 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -387,12 +387,14 @@ namespace OpenSim.Services.InventoryService | |||
387 | } | 387 | } |
388 | 388 | ||
389 | // See IInventoryServices | 389 | // See IInventoryServices |
390 | public virtual bool DeleteItem(InventoryItemBase item) | 390 | public virtual bool DeleteItems(UUID owner, List<UUID> itemIDs) |
391 | { | 391 | { |
392 | m_log.InfoFormat( | 392 | m_log.InfoFormat( |
393 | "[INVENTORY SERVICE]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); | 393 | "[INVENTORY SERVICE]: Deleting {0} items from user {1}", itemIDs.Count, owner); |
394 | 394 | ||
395 | m_Database.deleteInventoryItem(item.ID); | 395 | // uhh..... |
396 | foreach (UUID uuid in itemIDs) | ||
397 | m_Database.deleteInventoryItem(uuid); | ||
396 | 398 | ||
397 | // FIXME: Should return false on failure | 399 | // FIXME: Should return false on failure |
398 | return true; | 400 | return true; |
@@ -439,10 +441,12 @@ namespace OpenSim.Services.InventoryService | |||
439 | 441 | ||
440 | List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID); | 442 | List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID); |
441 | 443 | ||
444 | List<UUID> uuids = new List<UUID>(); | ||
442 | foreach (InventoryItemBase item in items) | 445 | foreach (InventoryItemBase item in items) |
443 | { | 446 | { |
444 | DeleteItem(item); | 447 | uuids.Add(item.ID); |
445 | } | 448 | } |
449 | DeleteItems(folder.Owner, uuids); | ||
446 | 450 | ||
447 | // FIXME: Should return false on failure | 451 | // FIXME: Should return false on failure |
448 | return true; | 452 | return true; |
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index ba9cbe9..f770f75 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs | |||
@@ -143,7 +143,7 @@ namespace OpenSim.Tests.Common.Mock | |||
143 | return false; | 143 | return false; |
144 | } | 144 | } |
145 | 145 | ||
146 | public bool DeleteItem(InventoryItemBase item) | 146 | public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
147 | { | 147 | { |
148 | return false; | 148 | return false; |
149 | } | 149 | } |