Introduce a way to send the grid's message kay, if one is used

0.9.1.0-post-fixes
Melanie 2019-10-06 23:24:41 +01:00
parent 22599fbf29
commit eb55f7f2bc
2 changed files with 9 additions and 5 deletions

View File

@ -50,9 +50,9 @@ namespace OpenSim.Services.Connectors.InstantMessage
/// <param name="url">URL we pull the data out of to send the request to</param>
/// <param name="im">The Instant Message </param>
/// <returns>Bool if the message was successfully delivered at the other side.</returns>
public static bool SendInstantMessage(string url, GridInstantMessage im)
public static bool SendInstantMessage(string url, GridInstantMessage im, string messageKey)
{
Hashtable xmlrpcdata = ConvertGridInstantMessageToXMLRPC(im);
Hashtable xmlrpcdata = ConvertGridInstantMessageToXMLRPC(im, messageKey);
xmlrpcdata["region_handle"] = 0;
ArrayList SendParams = new ArrayList();
@ -97,7 +97,7 @@ namespace OpenSim.Services.Connectors.InstantMessage
/// </summary>
/// <param name="msg">The GridInstantMessage object</param>
/// <returns>Hashtable containing the XMLRPC request</returns>
protected static Hashtable ConvertGridInstantMessageToXMLRPC(GridInstantMessage msg)
protected static Hashtable ConvertGridInstantMessageToXMLRPC(GridInstantMessage msg, string messageKey)
{
Hashtable gim = new Hashtable();
gim["from_agent_id"] = msg.fromAgentID.ToString();
@ -125,6 +125,9 @@ namespace OpenSim.Services.Connectors.InstantMessage
gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket, Base64FormattingOptions.None);
gim["region_id"] = new UUID(msg.RegionID).ToString();
if (messageKey != String.Empty)
gim["message_key"] = messageKey;
return gim;
}

View File

@ -118,6 +118,7 @@ namespace OpenSim.Services.HypergridService
return;
}
m_messageKey = cnf.GetString("MessageKey", String.Empty);
m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", false);
if (m_InGatekeeper)
@ -282,7 +283,7 @@ namespace OpenSim.Services.HypergridService
if (reginfo != null)
{
imresult = InstantMessageServiceConnector.SendInstantMessage(reginfo.ServerURI, im);
imresult = InstantMessageServiceConnector.SendInstantMessage(reginfo.ServerURI, im, m_messageKey);
}
else
{
@ -373,4 +374,4 @@ namespace OpenSim.Services.HypergridService
return m_OfflineIMService.StoreMessage(im, out reason);
}
}
}
}