aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs58
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs5
2 files changed, 55 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 6badc74..e9e7c25 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
175 if (im.binaryBucket.Length < 17) // Invalid 175 if (im.binaryBucket.Length < 17) // Invalid
176 return; 176 return;
177 177
178 UUID receipientID = new UUID(im.toAgentID); 178 UUID recipientID = new UUID(im.toAgentID);
179 ScenePresence user = scene.GetScenePresence(receipientID); 179 ScenePresence user = scene.GetScenePresence(recipientID);
180 UUID copyID; 180 UUID copyID;
181 181
182 // First byte is the asset type 182 // First byte is the asset type
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
191 folderID, new UUID(im.toAgentID)); 191 folderID, new UUID(im.toAgentID));
192 192
193 InventoryFolderBase folderCopy 193 InventoryFolderBase folderCopy
194 = scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero); 194 = scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero);
195 195
196 if (folderCopy == null) 196 if (folderCopy == null)
197 { 197 {
@@ -419,22 +419,64 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
419 /// 419 ///
420 /// </summary> 420 /// </summary>
421 /// <param name="msg"></param> 421 /// <param name="msg"></param>
422 private void OnGridInstantMessage(GridInstantMessage msg) 422 private void OnGridInstantMessage(GridInstantMessage im)
423 { 423 {
424 // Check if this is ours to handle 424 // Check if this is ours to handle
425 // 425 //
426 Scene scene = FindClientScene(new UUID(msg.toAgentID)); 426 Scene scene = FindClientScene(new UUID(im.toAgentID));
427 427
428 if (scene == null) 428 if (scene == null)
429 return; 429 return;
430 430
431 // Find agent to deliver to 431 // Find agent to deliver to
432 // 432 //
433 ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID)); 433 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
434 if (user == null)
435 return;
436
437 // This requires a little bit of processing because we have to make the
438 // new item visible in the recipient's inventory here
439 //
440 if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
441 {
442 if (im.binaryBucket.Length < 17) // Invalid
443 return;
444
445 UUID recipientID = new UUID(im.toAgentID);
446
447 // First byte is the asset type
448 AssetType assetType = (AssetType)im.binaryBucket[0];
449
450 if (AssetType.Folder == assetType)
451 {
452 UUID folderID = new UUID(im.binaryBucket, 1);
434 453
435 // Just forward to local handling 454 InventoryFolderBase given =
436 OnInstantMessage(user.ControllingClient, msg); 455 new InventoryFolderBase(folderID, recipientID);
456 InventoryFolderBase folder =
457 scene.InventoryService.GetFolder(given);
458
459 if (folder != null)
460 user.ControllingClient.SendBulkUpdateInventory(folder);
461 }
462 else
463 {
464 UUID itemID = new UUID(im.binaryBucket, 1);
465
466 InventoryItemBase given =
467 new InventoryItemBase(itemID, recipientID);
468 InventoryItemBase item =
469 scene.InventoryService.GetItem(given);
470
471 if (item != null)
472 {
473 user.ControllingClient.SendBulkUpdateInventory(item);
474 }
475 }
476 }
437 477
478 // Just forward to the client
479 user.ControllingClient.SendInstantMessage(im);
438 } 480 }
439 } 481 }
440} 482}
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b016065..a462133 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1760,6 +1760,11 @@ namespace OpenSim.Region.Framework.Scenes
1760 // 1760 //
1761 foreach (SceneObjectGroup g in affectedGroups) 1761 foreach (SceneObjectGroup g in affectedGroups)
1762 { 1762 {
1763 // Child prims that have been unlinked and deleted will
1764 // return unless the root is deleted. This will remove them
1765 // from the database. They will be rewritten immediately,
1766 // minus the rows for the unlinked child prims.
1767 m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID);
1763 g.TriggerScriptChangedEvent(Changed.LINK); 1768 g.TriggerScriptChangedEvent(Changed.LINK);
1764 g.HasGroupChanged = true; // Persist 1769 g.HasGroupChanged = true; // Persist
1765 g.areUpdatesSuspended = false; 1770 g.areUpdatesSuspended = false;