Allow RLV to redirect received folders to #RLV folder

avinationmerge
Melanie 2012-03-11 18:21:47 +01:00
parent 4f7ec1d691
commit 44ce068d6c
1 changed files with 33 additions and 0 deletions

View File

@ -268,6 +268,39 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted ||
im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
{
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
IInventoryService invService = scene.InventoryService;
// Special case: folder redirect.
// RLV uses this
if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
{
InventoryFolderBase folder = new InventoryFolderBase(inventoryID, client.AgentId);
folder = invService.GetFolder(folder);
if (folder != null)
{
if (im.binaryBucket.Length >= 16)
{
UUID destFolderID = new UUID(im.binaryBucket, 0);
if (destFolderID != UUID.Zero)
{
InventoryFolderBase destFolder = new InventoryFolderBase(destFolderID, client.AgentId);
destFolder = invService.GetFolder(destFolder);
if (destFolder != null)
{
if (folder.ParentID != destFolder.ID)
{
folder.ParentID = destFolder.ID;
invService.MoveFolder(folder);
client.SendBulkUpdateInventory(folder);
}
}
}
}
}
}
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
if (user != null) // Local