diff options
author | Melanie | 2012-10-07 02:48:28 +0100 |
---|---|---|
committer | Melanie | 2012-10-07 02:48:28 +0100 |
commit | f7df68d922758c0a78664abe82d631579f6aa63f (patch) | |
tree | 85daa41ff4b35653b4fbb987cbc852ad853decef /OpenSim/Region/CoreModules/Avatar/Inventory | |
parent | Merge branch 'master' into careminster (diff) | |
parent | refactor: Rename UserSessioNID -> UserSession in WebStatsModule since this is... (diff) | |
download | opensim-SC-f7df68d922758c0a78664abe82d631579f6aa63f.zip opensim-SC-f7df68d922758c0a78664abe82d631579f6aa63f.tar.gz opensim-SC-f7df68d922758c0a78664abe82d631579f6aa63f.tar.bz2 opensim-SC-f7df68d922758c0a78664abe82d631579f6aa63f.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
OpenSim/Region/Framework/Scenes/Scene.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index c14cb17..21dff4b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -313,6 +313,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
313 | m_TransferModule.SendInstantMessage(im, delegate(bool success) {}); | 313 | m_TransferModule.SendInstantMessage(im, delegate(bool success) {}); |
314 | } | 314 | } |
315 | } | 315 | } |
316 | |||
317 | // XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name> | ||
318 | // to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis | ||
319 | // of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously | ||
320 | // done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here. | ||
316 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | 321 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) |
317 | { | 322 | { |
318 | UUID destinationFolderID = UUID.Zero; | 323 | UUID destinationFolderID = UUID.Zero; |
@@ -324,6 +329,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
324 | 329 | ||
325 | if (destinationFolderID != UUID.Zero) | 330 | if (destinationFolderID != UUID.Zero) |
326 | { | 331 | { |
332 | InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId); | ||
333 | if (destinationFolder == null) | ||
334 | { | ||
335 | m_log.WarnFormat( | ||
336 | "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist", | ||
337 | client.Name, scene.Name, destinationFolderID); | ||
338 | |||
339 | return; | ||
340 | } | ||
341 | |||
327 | IInventoryService invService = scene.InventoryService; | 342 | IInventoryService invService = scene.InventoryService; |
328 | 343 | ||
329 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 344 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
@@ -331,9 +346,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
331 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 346 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); |
332 | item = invService.GetItem(item); | 347 | item = invService.GetItem(item); |
333 | InventoryFolderBase folder = null; | 348 | InventoryFolderBase folder = null; |
349 | UUID? previousParentFolderID = null; | ||
334 | 350 | ||
335 | if (item != null) // It's an item | 351 | if (item != null) // It's an item |
336 | { | 352 | { |
353 | previousParentFolderID = item.Folder; | ||
337 | item.Folder = destinationFolderID; | 354 | item.Folder = destinationFolderID; |
338 | 355 | ||
339 | invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); | 356 | invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); |
@@ -346,10 +363,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
346 | 363 | ||
347 | if (folder != null) // It's a folder | 364 | if (folder != null) // It's a folder |
348 | { | 365 | { |
366 | previousParentFolderID = folder.ParentID; | ||
349 | folder.ParentID = destinationFolderID; | 367 | folder.ParentID = destinationFolderID; |
350 | invService.MoveFolder(folder); | 368 | invService.MoveFolder(folder); |
351 | } | 369 | } |
352 | } | 370 | } |
371 | |||
372 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | ||
373 | if (previousParentFolderID != null) | ||
374 | { | ||
375 | InventoryFolderBase previousParentFolder | ||
376 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
377 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
378 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | ||
379 | |||
380 | scene.SendInventoryUpdate(client, destinationFolder, true, true); | ||
381 | } | ||
353 | } | 382 | } |
354 | } | 383 | } |
355 | else if ( | 384 | else if ( |
@@ -370,9 +399,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
370 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 399 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); |
371 | item = invService.GetItem(item); | 400 | item = invService.GetItem(item); |
372 | InventoryFolderBase folder = null; | 401 | InventoryFolderBase folder = null; |
402 | UUID? previousParentFolderID = null; | ||
373 | 403 | ||
374 | if (item != null && trashFolder != null) | 404 | if (item != null && trashFolder != null) |
375 | { | 405 | { |
406 | previousParentFolderID = item.Folder; | ||
376 | item.Folder = trashFolder.ID; | 407 | item.Folder = trashFolder.ID; |
377 | 408 | ||
378 | // Diva comment: can't we just update this item??? | 409 | // Diva comment: can't we just update this item??? |
@@ -388,6 +419,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
388 | 419 | ||
389 | if (folder != null & trashFolder != null) | 420 | if (folder != null & trashFolder != null) |
390 | { | 421 | { |
422 | previousParentFolderID = folder.ParentID; | ||
391 | folder.ParentID = trashFolder.ID; | 423 | folder.ParentID = trashFolder.ID; |
392 | invService.MoveFolder(folder); | 424 | invService.MoveFolder(folder); |
393 | client.SendBulkUpdateInventory(folder); | 425 | client.SendBulkUpdateInventory(folder); |
@@ -408,6 +440,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
408 | client.SendAgentAlertMessage("Unable to delete "+ | 440 | client.SendAgentAlertMessage("Unable to delete "+ |
409 | "received inventory" + reason, false); | 441 | "received inventory" + reason, false); |
410 | } | 442 | } |
443 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | ||
444 | else if (previousParentFolderID != null) | ||
445 | { | ||
446 | InventoryFolderBase previousParentFolder | ||
447 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
448 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
449 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | ||
450 | |||
451 | scene.SendInventoryUpdate(client, trashFolder, true, true); | ||
452 | } | ||
411 | 453 | ||
412 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 454 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
413 | 455 | ||