aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Avatar/InstantMessage
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/InstantMessage')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs30
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/InstantMessage/MessageTransferModule.cs8
2 files changed, 5 insertions, 33 deletions
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
110 110
111 #endregion 111 #endregion
112 112
113 private void OnInstantMessage(IClientAPI client, UUID fromAgentID, 113 public void OnInstantMessage(IClientAPI client, GridInstantMessage im)
114 UUID fromAgentSession, UUID toAgentID,
115 UUID imSessionID, uint timestamp, string fromAgentName,
116 string message, byte dialog, bool fromGroup, byte offline,
117 uint ParentEstateID, Vector3 Position, UUID RegionID,
118 byte[] binaryBucket)
119 {
120 // This module handles exclusively private text IM from user
121 // to user. All others will be caught in other modules
122 //
123 if ( dialog != (byte)InstantMessageDialog.MessageFromAgent
124 && dialog != (byte)InstantMessageDialog.StartTyping
125 && dialog != (byte)InstantMessageDialog.StopTyping)
126 {
127 return;
128 }
129
130 GridInstantMessage im = new GridInstantMessage(client.Scene,
131 fromAgentID, fromAgentName, fromAgentSession, toAgentID,
132 dialog, fromGroup, message, imSessionID,
133 offline != 0 ? true : false, Position,
134 binaryBucket);
135
136 ProcessInstantMessage(client, im);
137 }
138
139 private void ProcessInstantMessage(IClientAPI client, GridInstantMessage im)
140 { 114 {
141 byte dialog = im.dialog; 115 byte dialog = im.dialog;
142 116
@@ -183,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
183 // so we can depend on the above not trying to send 157 // so we can depend on the above not trying to send
184 // via grid again 158 // via grid again
185 // 159 //
186 ProcessInstantMessage(null, msg); 160 OnInstantMessage(null, msg);
187 } 161 }
188 } 162 }
189} 163}
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
185 bool successful = false; 185 bool successful = false;
186 // various rational defaults 186 // various rational defaults
187 UUID fromAgentID = UUID.Zero; 187 UUID fromAgentID = UUID.Zero;
188 UUID fromAgentSession = UUID.Zero;
189 UUID toAgentID = UUID.Zero; 188 UUID toAgentID = UUID.Zero;
190 UUID imSessionID = UUID.Zero; 189 UUID imSessionID = UUID.Zero;
191 uint timestamp = 0; 190 uint timestamp = 0;
@@ -207,7 +206,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
207 206
208 Hashtable requestData = (Hashtable)request.Params[0]; 207 Hashtable requestData = (Hashtable)request.Params[0];
209 // Check if it's got all the data 208 // Check if it's got all the data
210 if (requestData.ContainsKey("from_agent_id") && requestData.ContainsKey("from_agent_session") 209 if (requestData.ContainsKey("from_agent_id")
211 && requestData.ContainsKey("to_agent_id") && requestData.ContainsKey("im_session_id") 210 && requestData.ContainsKey("to_agent_id") && requestData.ContainsKey("im_session_id")
212 && requestData.ContainsKey("timestamp") && requestData.ContainsKey("from_agent_name") 211 && requestData.ContainsKey("timestamp") && requestData.ContainsKey("from_agent_name")
213 && requestData.ContainsKey("message") && requestData.ContainsKey("dialog") 212 && requestData.ContainsKey("message") && requestData.ContainsKey("dialog")
@@ -219,7 +218,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
219 { 218 {
220 // Do the easy way of validating the UUIDs 219 // Do the easy way of validating the UUIDs
221 UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID); 220 UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID);
222 UUID.TryParse((string)requestData["from_agent_session"], out fromAgentSession);
223 UUID.TryParse((string)requestData["to_agent_id"], out toAgentID); 221 UUID.TryParse((string)requestData["to_agent_id"], out toAgentID);
224 UUID.TryParse((string)requestData["im_session_id"], out imSessionID); 222 UUID.TryParse((string)requestData["im_session_id"], out imSessionID);
225 UUID.TryParse((string)requestData["region_id"], out RegionID); 223 UUID.TryParse((string)requestData["region_id"], out RegionID);
@@ -337,7 +335,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
337 GridInstantMessage gim = new GridInstantMessage(); 335 GridInstantMessage gim = new GridInstantMessage();
338 gim.fromAgentID = fromAgentID.Guid; 336 gim.fromAgentID = fromAgentID.Guid;
339 gim.fromAgentName = fromAgentName; 337 gim.fromAgentName = fromAgentName;
340 gim.fromAgentSession = fromAgentSession.Guid;
341 gim.fromGroup = fromGroup; 338 gim.fromGroup = fromGroup;
342 gim.imSessionID = imSessionID.Guid; 339 gim.imSessionID = imSessionID.Guid;
343 gim.RegionID = RegionID.Guid; 340 gim.RegionID = RegionID.Guid;
@@ -598,7 +595,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
598 { 595 {
599 Hashtable gim = new Hashtable(); 596 Hashtable gim = new Hashtable();
600 gim["from_agent_id"] = msg.fromAgentID.ToString(); 597 gim["from_agent_id"] = msg.fromAgentID.ToString();
601 gim["from_agent_session"] = msg.fromAgentSession.ToString(); 598 // Kept for compatibility
599 gim["from_agent_session"] = UUID.Zero.ToString();
602 gim["to_agent_id"] = msg.toAgentID.ToString(); 600 gim["to_agent_id"] = msg.toAgentID.ToString();
603 gim["im_session_id"] = msg.imSessionID.ToString(); 601 gim["im_session_id"] = msg.imSessionID.ToString();
604 gim["timestamp"] = msg.timestamp.ToString(); 602 gim["timestamp"] = msg.timestamp.ToString();