diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index d2946922cd..eb14603a36 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs @@ -302,41 +302,24 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return string.Empty; } - /// - /// Find the scene for an agent + /// Find the root client for a ID /// - private Scene GetClientScene(UUID agentId) + public IClientAPI LocateClientObject(UUID agentID) { lock (m_Scenes) { foreach (Scene scene in m_Scenes) { - ScenePresence presence = scene.GetScenePresence(agentId); + ScenePresence presence = scene.GetScenePresence(agentID); if (presence != null && !presence.IsChildAgent) - return scene; + return presence.ControllingClient; } } return null; } - /// - /// Find the client for a ID - /// - public IClientAPI LocateClientObject(UUID agentID) - { - Scene scene = GetClientScene(agentID); - if (scene != null) - { - ScenePresence presence = scene.GetScenePresence(agentID); - if (presence != null) - return presence.ControllingClient; - } - - return null; - } - #region IInstantMessageSimConnector public bool SendInstantMessage(GridInstantMessage im) {