mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Fix task inventory giving
This commit is contained in:
@@ -146,20 +146,13 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
ScenePresence sp = scene.GetScenePresence(toAgentID);
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
|
||||
// toAgentID.ToString(), scene.RegionInfo.RegionName);
|
||||
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
if (!user.IsChildAgent)
|
||||
{
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
// Local message
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
|
||||
sp.ControllingClient.SendInstantMessage(im);
|
||||
|
||||
// Message sent
|
||||
result(true);
|
||||
return;
|
||||
}
|
||||
// Message sent
|
||||
result(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,10 +165,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
if (sp != null)
|
||||
{
|
||||
// Local message
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
|
||||
sp.ControllingClient.SendInstantMessage(im);
|
||||
|
||||
// Message sent
|
||||
result(true);
|
||||
|
||||
@@ -212,7 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
im.dialog != (byte)InstantMessageDialog.MessageFromAgent &&
|
||||
im.dialog != (byte)InstantMessageDialog.GroupNotice &&
|
||||
im.dialog != (byte)InstantMessageDialog.GroupInvitation &&
|
||||
im.dialog != (byte)InstantMessageDialog.InventoryOffered)
|
||||
im.dialog != (byte)InstantMessageDialog.InventoryOffered &&
|
||||
im.dialog != (byte)InstantMessageDialog.TaskInventoryOffered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted)
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted ||
|
||||
im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
|
||||
{
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||
|
||||
@@ -276,30 +277,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
else
|
||||
{
|
||||
if (m_TransferModule != null)
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) {
|
||||
|
||||
// justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011
|
||||
// and is apparently supposed to fix bulk inventory updates after accepting items. But
|
||||
// instead it appears to cause two copies of an accepted folder for the receiving user in
|
||||
// at least some cases. Folder/item update is already done when the offer is made (see code above)
|
||||
|
||||
// // Send BulkUpdateInventory
|
||||
// IInventoryService invService = scene.InventoryService;
|
||||
// UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip
|
||||
//
|
||||
// InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId);
|
||||
// folder = invService.GetFolder(folder);
|
||||
//
|
||||
// ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID));
|
||||
//
|
||||
// // If the user has left the scene by the time the message comes back then we can't send
|
||||
// // them the update.
|
||||
// if (fromUser != null)
|
||||
// fromUser.ControllingClient.SendBulkUpdateInventory(folder);
|
||||
});
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) {});
|
||||
}
|
||||
}
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined)
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined ||
|
||||
im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined)
|
||||
{
|
||||
// Here, the recipient is local and we can assume that the
|
||||
// inventory is loaded. Courtesy of the above bulk update,
|
||||
@@ -335,6 +317,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
folder.ParentID = trashFolder.ID;
|
||||
invService.MoveFolder(folder);
|
||||
client.SendBulkUpdateInventory(folder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user