bug fix: do not duplicate received ims on several regions per instance case

This commit is contained in:
UbitUmarov
2022-02-09 21:32:10 +00:00
parent f4ae8d90ef
commit aa7ef54d6b

View File

@@ -211,7 +211,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
protected bool SendIMToScene(GridInstantMessage gim, UUID toAgentID)
{
bool successful = false;
Scene childScene = null;
foreach (Scene scene in m_Scenes)
{
@@ -223,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
else
{
scene.EventManager.TriggerIncomingInstantMessage(gim);
successful = true;
return true;
}
}
}
@@ -231,22 +230,18 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
if(childScene != null)
{
childScene.EventManager.TriggerIncomingInstantMessage(gim);
successful = true;
return true;
}
if (!successful)
{
// If the message can't be delivered to an agent, it
// is likely to be a group IM. On a group IM, the
// imSessionID = toAgentID = group id. Raise the
// unhandled IM event to give the groups module
// a chance to pick it up. We raise that in a random
// scene, since the groups module is shared.
//
m_Scenes[0].EventManager.TriggerUnhandledInstantMessage(gim);
}
return successful;
// If the message can't be delivered to an agent, it
// is likely to be a group IM. On a group IM, the
// imSessionID = toAgentID = group id. Raise the
// unhandled IM event to give the groups module
// a chance to pick it up. We raise that in a random
// scene, since the groups module is shared.
//
m_Scenes[0].EventManager.TriggerUnhandledInstantMessage(gim);
return false;
}
public void HandleUndeliverableMessage(GridInstantMessage im, MessageResultNotification result)