diff options
author | Dan Lake | 2012-10-08 15:25:26 -0700 |
---|---|---|
committer | Dan Lake | 2012-10-08 15:25:26 -0700 |
commit | d342adaa8760ee7ada1b87dec1c8c415c9e77f73 (patch) | |
tree | a914c203322b761640450c7be06c54984b64494d /OpenSim/Region/CoreModules/Avatar/Inventory/Transfer | |
parent | Add bool to TriggerSceneObjectPartUpdated where full = true indicates a full ... (diff) | |
parent | Fix build break (diff) | |
download | opensim-SC_OLD-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.zip opensim-SC_OLD-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.tar.gz opensim-SC_OLD-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.tar.bz2 opensim-SC_OLD-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.tar.xz |
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Transfer')
-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 91eda19..33b4839 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -297,6 +297,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
297 | }); | 297 | }); |
298 | } | 298 | } |
299 | } | 299 | } |
300 | |||
301 | // XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name> | ||
302 | // to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis | ||
303 | // of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously | ||
304 | // done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here. | ||
300 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | 305 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) |
301 | { | 306 | { |
302 | UUID destinationFolderID = UUID.Zero; | 307 | UUID destinationFolderID = UUID.Zero; |
@@ -308,6 +313,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
308 | 313 | ||
309 | if (destinationFolderID != UUID.Zero) | 314 | if (destinationFolderID != UUID.Zero) |
310 | { | 315 | { |
316 | InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId); | ||
317 | if (destinationFolder == null) | ||
318 | { | ||
319 | m_log.WarnFormat( | ||
320 | "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist", | ||
321 | client.Name, scene.Name, destinationFolderID); | ||
322 | |||
323 | return; | ||
324 | } | ||
325 | |||
311 | IInventoryService invService = scene.InventoryService; | 326 | IInventoryService invService = scene.InventoryService; |
312 | 327 | ||
313 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 328 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
@@ -315,9 +330,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
315 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 330 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); |
316 | item = invService.GetItem(item); | 331 | item = invService.GetItem(item); |
317 | InventoryFolderBase folder = null; | 332 | InventoryFolderBase folder = null; |
333 | UUID? previousParentFolderID = null; | ||
318 | 334 | ||
319 | if (item != null) // It's an item | 335 | if (item != null) // It's an item |
320 | { | 336 | { |
337 | previousParentFolderID = item.Folder; | ||
321 | item.Folder = destinationFolderID; | 338 | item.Folder = destinationFolderID; |
322 | 339 | ||
323 | invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); | 340 | invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); |
@@ -330,10 +347,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
330 | 347 | ||
331 | if (folder != null) // It's a folder | 348 | if (folder != null) // It's a folder |
332 | { | 349 | { |
350 | previousParentFolderID = folder.ParentID; | ||
333 | folder.ParentID = destinationFolderID; | 351 | folder.ParentID = destinationFolderID; |
334 | invService.MoveFolder(folder); | 352 | invService.MoveFolder(folder); |
335 | } | 353 | } |
336 | } | 354 | } |
355 | |||
356 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | ||
357 | if (previousParentFolderID != null) | ||
358 | { | ||
359 | InventoryFolderBase previousParentFolder | ||
360 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
361 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
362 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | ||
363 | |||
364 | scene.SendInventoryUpdate(client, destinationFolder, true, true); | ||
365 | } | ||
337 | } | 366 | } |
338 | } | 367 | } |
339 | else if ( | 368 | else if ( |
@@ -354,9 +383,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
354 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 383 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); |
355 | item = invService.GetItem(item); | 384 | item = invService.GetItem(item); |
356 | InventoryFolderBase folder = null; | 385 | InventoryFolderBase folder = null; |
386 | UUID? previousParentFolderID = null; | ||
357 | 387 | ||
358 | if (item != null && trashFolder != null) | 388 | if (item != null && trashFolder != null) |
359 | { | 389 | { |
390 | previousParentFolderID = item.Folder; | ||
360 | item.Folder = trashFolder.ID; | 391 | item.Folder = trashFolder.ID; |
361 | 392 | ||
362 | // Diva comment: can't we just update this item??? | 393 | // Diva comment: can't we just update this item??? |
@@ -372,6 +403,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
372 | 403 | ||
373 | if (folder != null & trashFolder != null) | 404 | if (folder != null & trashFolder != null) |
374 | { | 405 | { |
406 | previousParentFolderID = folder.ParentID; | ||
375 | folder.ParentID = trashFolder.ID; | 407 | folder.ParentID = trashFolder.ID; |
376 | invService.MoveFolder(folder); | 408 | invService.MoveFolder(folder); |
377 | } | 409 | } |
@@ -391,6 +423,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
391 | client.SendAgentAlertMessage("Unable to delete "+ | 423 | client.SendAgentAlertMessage("Unable to delete "+ |
392 | "received inventory" + reason, false); | 424 | "received inventory" + reason, false); |
393 | } | 425 | } |
426 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | ||
427 | else if (previousParentFolderID != null) | ||
428 | { | ||
429 | InventoryFolderBase previousParentFolder | ||
430 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
431 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
432 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | ||
433 | |||
434 | scene.SendInventoryUpdate(client, trashFolder, true, true); | ||
435 | } | ||
394 | 436 | ||
395 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 437 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
396 | 438 | ||