From 5e2e05a1c1cf083c52728798c809711f4e2f52ae Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 16 Nov 2008 22:04:01 +0000 Subject: Megapatch. Completely remove the multiparameter IM methods. Remove the insecure fromAgentSession field. --- .../Avatar/InstantMessage/InstantMessageModule.cs | 30 ++-------------------- .../Avatar/InstantMessage/MessageTransferModule.cs | 8 +++--- 2 files changed, 5 insertions(+), 33 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Avatar/InstantMessage') diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs index cd8c82c..b106435 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs @@ -110,33 +110,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage #endregion - private void OnInstantMessage(IClientAPI client, UUID fromAgentID, - UUID fromAgentSession, UUID toAgentID, - UUID imSessionID, uint timestamp, string fromAgentName, - string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, Vector3 Position, UUID RegionID, - byte[] binaryBucket) - { - // This module handles exclusively private text IM from user - // to user. All others will be caught in other modules - // - if ( dialog != (byte)InstantMessageDialog.MessageFromAgent - && dialog != (byte)InstantMessageDialog.StartTyping - && dialog != (byte)InstantMessageDialog.StopTyping) - { - return; - } - - GridInstantMessage im = new GridInstantMessage(client.Scene, - fromAgentID, fromAgentName, fromAgentSession, toAgentID, - dialog, fromGroup, message, imSessionID, - offline != 0 ? true : false, Position, - binaryBucket); - - ProcessInstantMessage(client, im); - } - - private void ProcessInstantMessage(IClientAPI client, GridInstantMessage im) + public void OnInstantMessage(IClientAPI client, GridInstantMessage im) { byte dialog = im.dialog; @@ -183,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage // so we can depend on the above not trying to send // via grid again // - ProcessInstantMessage(null, msg); + OnInstantMessage(null, msg); } } } diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/MessageTransferModule.cs index 0dc29a1..67346ae 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/MessageTransferModule.cs @@ -185,7 +185,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage bool successful = false; // various rational defaults UUID fromAgentID = UUID.Zero; - UUID fromAgentSession = UUID.Zero; UUID toAgentID = UUID.Zero; UUID imSessionID = UUID.Zero; uint timestamp = 0; @@ -207,7 +206,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage Hashtable requestData = (Hashtable)request.Params[0]; // Check if it's got all the data - if (requestData.ContainsKey("from_agent_id") && requestData.ContainsKey("from_agent_session") + if (requestData.ContainsKey("from_agent_id") && requestData.ContainsKey("to_agent_id") && requestData.ContainsKey("im_session_id") && requestData.ContainsKey("timestamp") && requestData.ContainsKey("from_agent_name") && requestData.ContainsKey("message") && requestData.ContainsKey("dialog") @@ -219,7 +218,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage { // Do the easy way of validating the UUIDs UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID); - UUID.TryParse((string)requestData["from_agent_session"], out fromAgentSession); UUID.TryParse((string)requestData["to_agent_id"], out toAgentID); UUID.TryParse((string)requestData["im_session_id"], out imSessionID); UUID.TryParse((string)requestData["region_id"], out RegionID); @@ -337,7 +335,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage GridInstantMessage gim = new GridInstantMessage(); gim.fromAgentID = fromAgentID.Guid; gim.fromAgentName = fromAgentName; - gim.fromAgentSession = fromAgentSession.Guid; gim.fromGroup = fromGroup; gim.imSessionID = imSessionID.Guid; gim.RegionID = RegionID.Guid; @@ -598,7 +595,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage { Hashtable gim = new Hashtable(); gim["from_agent_id"] = msg.fromAgentID.ToString(); - gim["from_agent_session"] = msg.fromAgentSession.ToString(); + // Kept for compatibility + gim["from_agent_session"] = UUID.Zero.ToString(); gim["to_agent_id"] = msg.toAgentID.ToString(); gim["im_session_id"] = msg.imSessionID.ToString(); gim["timestamp"] = msg.timestamp.ToString(); -- cgit v1.1