diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 1b652a02f3..8ad9df8cef 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -73,6 +73,7 @@ namespace OpenSim.Services.HypergridService private static Uri m_Uri; private static GridRegion m_DefaultGatewayRegion; private bool m_allowDuplicatePresences = false; + private static string m_messageKey; public GatekeeperService(IConfigSource config, ISimulationService simService) { @@ -154,6 +155,9 @@ namespace OpenSim.Services.HypergridService m_allowDuplicatePresences = presenceConfig.GetBoolean("AllowDuplicatePresences", m_allowDuplicatePresences); } + IConfig messagingConfig = config.Configs["Messaging"]; + if (messagingConfig != null) + m_messageKey = messagingConfig.GetString("MessageKey", String.Empty); m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); } } @@ -651,7 +655,7 @@ namespace OpenSim.Services.HypergridService msg.Position = Vector3.Zero; msg.RegionID = scopeID.Guid; msg.binaryBucket = new byte[1] {0}; - InstantMessageServiceConnector.SendInstantMessage(regURL,msg); + InstantMessageServiceConnector.SendInstantMessage(regURL,msg, m_messageKey); m_GridUserService.LoggedOut(agentID.ToString(), UUID.Zero, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index 09c5354467..4d628e0ac0 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs @@ -70,6 +70,7 @@ namespace OpenSim.Services.HypergridService private static bool m_ForwardOfflineGroupMessages; private static bool m_InGatekeeper; + private string m_messageKey; public HGInstantMessageService(IConfigSource config) : this(config, null) @@ -322,7 +323,7 @@ namespace OpenSim.Services.HypergridService bool ForwardIMToGrid(string url, GridInstantMessage im, UUID toAgentID, bool foreigner) { - if (InstantMessageServiceConnector.SendInstantMessage(url, im)) + if (InstantMessageServiceConnector.SendInstantMessage(url, im, m_messageKey)) { // IM delivery successful, so store the Agent's location in our local cache. lock (m_UserLocationMap) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 22cdff5cd8..9b8ea37255 100755 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -92,6 +92,7 @@ namespace OpenSim.Services.LLLoginService protected string m_MessageUrl; protected string m_DSTZone; protected bool m_allowDuplicatePresences = false; + protected string m_messageKey; IConfig m_LoginServerConfig; // IConfig m_ClientsConfig; @@ -159,6 +160,9 @@ namespace OpenSim.Services.LLLoginService m_MapTileURL = m_MapTileURL + "/"; } + IConfig messagingConfig = config.Configs["Messaging"]; + if (messagingConfig != null) + m_messageKey = messagingConfig.GetString("MessageKey", String.Empty); // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) throw new Exception("LoginService is missing service specifications"); @@ -1170,7 +1174,7 @@ namespace OpenSim.Services.LLLoginService msg.Position = Vector3.Zero; msg.RegionID = scopeID.Guid; msg.binaryBucket = new byte[1] {0}; - InstantMessageServiceConnector.SendInstantMessage(regURL,msg); + InstantMessageServiceConnector.SendInstantMessage(regURL,msg, m_messageKey); m_GridUserService.LoggedOut(agentID.ToString(), UUID.Zero, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); diff --git a/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs index 8f312ebe10..4eba7b9084 100644 --- a/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs +++ b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs @@ -50,7 +50,7 @@ namespace Robust.Tests im.message = "Hello"; im.imSessionID = new Guid(); - bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im); + bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im, String.Empty); Assert.IsFalse(success, "Sending of IM succeeded, but it should have failed"); }