diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index 68fef29ea8..24286a44ca 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -239,11 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
GridRegion gatekeeper = new GridRegion();
gatekeeper.ServerURI = url;
-
- string homeURI = null;
- AgentCircuitData acd = scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId);
- if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
- homeURI = (string)acd.ServiceURLs["HomeURI"];
+ string homeURI = scene.GetAgentHomeURI(client.AgentId);
string message;
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(im.RegionID), client.AgentId, homeURI, out message);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 4ecb8e6373..3d9c93f8fa 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -529,10 +529,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (reg != null)
{
- string homeURI = null;
- AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.AgentId);
- if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
- homeURI = (string)acd.ServiceURLs["HomeURI"];
+ string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId);
string message;
finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out message);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 5b7dfe3500..52e0d5aab1 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -532,11 +532,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
GridRegion gatekeeper = new GridRegion();
gatekeeper.ServerURI = lm.Gatekeeper;
-
- string homeURI = null;
- AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(remoteClient.AgentId);
- if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
- homeURI = (string)acd.ServiceURLs["HomeURI"];
+ string homeURI = Scene.GetAgentHomeURI(remoteClient.AgentId);
string message;
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), remoteClient.AgentId, homeURI, out message);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 19d4e84a0c..3ff21eaa5f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2675,6 +2675,18 @@ namespace OpenSim.Region.Framework.Scenes
return sp;
}
+ ///
+ /// Returns the Home URI of the agent, or null if unknown.
+ ///
+ public string GetAgentHomeURI(UUID agentID)
+ {
+ AgentCircuitData circuit = AuthenticateHandler.GetAgentCircuitData(agentID);
+ if (circuit != null && circuit.ServiceURLs != null && circuit.ServiceURLs.ContainsKey("HomeURI"))
+ return circuit.ServiceURLs["HomeURI"].ToString();
+ else
+ return null;
+ }
+
///
/// Cache the user name for later use.
///