diff options
author | teravus | 2012-11-15 10:05:16 -0500 |
---|---|---|
committer | teravus | 2012-11-15 10:05:16 -0500 |
commit | e9153e1d1aae50024d8cd05fe14a9bce34343a0e (patch) | |
tree | bc111d34f95a26b99c7e34d9e495dc14d1802cc3 /OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |
parent | Merge master into teravuswork (diff) | |
download | opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.zip opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.gz opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.bz2 opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.xz |
Revert "Merge master into teravuswork", it should have been avination, not master.
This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing
changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 4407e40..dbbb0ae 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -197,7 +197,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
197 | string fromName = c.From; | 197 | string fromName = c.From; |
198 | string fromNamePrefix = ""; | 198 | string fromNamePrefix = ""; |
199 | UUID fromID = UUID.Zero; | 199 | UUID fromID = UUID.Zero; |
200 | UUID ownerID = UUID.Zero; | ||
201 | string message = c.Message; | 200 | string message = c.Message; |
202 | IScene scene = c.Scene; | 201 | IScene scene = c.Scene; |
203 | UUID destination = c.Destination; | 202 | UUID destination = c.Destination; |
@@ -225,16 +224,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
225 | fromNamePrefix = m_adminPrefix; | 224 | fromNamePrefix = m_adminPrefix; |
226 | } | 225 | } |
227 | destination = UUID.Zero; // Avatars cant "SayTo" | 226 | destination = UUID.Zero; // Avatars cant "SayTo" |
228 | ownerID = c.Sender.AgentId; | ||
229 | |||
230 | break; | 227 | break; |
231 | 228 | ||
232 | case ChatSourceType.Object: | 229 | case ChatSourceType.Object: |
233 | fromID = c.SenderUUID; | 230 | fromID = c.SenderUUID; |
234 | 231 | ||
235 | if (c.SenderObject != null && c.SenderObject is SceneObjectPart) | ||
236 | ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; | ||
237 | |||
238 | break; | 232 | break; |
239 | } | 233 | } |
240 | 234 | ||
@@ -268,16 +262,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
268 | // objects on a parcel with access restrictions | 262 | // objects on a parcel with access restrictions |
269 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) | 263 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) |
270 | { | 264 | { |
271 | if (destination != UUID.Zero) | 265 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix + fromName, c.Type, message, sourceType)) |
272 | { | 266 | receiverIDs.Add(presence.UUID); |
273 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, ownerID, fromNamePrefix + fromName, c.Type, message, sourceType, true)) | ||
274 | receiverIDs.Add(presence.UUID); | ||
275 | } | ||
276 | else | ||
277 | { | ||
278 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, ownerID, fromNamePrefix + fromName, c.Type, message, sourceType, false)) | ||
279 | receiverIDs.Add(presence.UUID); | ||
280 | } | ||
281 | } | 267 | } |
282 | } | 268 | } |
283 | } | 269 | } |
@@ -338,7 +324,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
338 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 324 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) |
339 | return; | 325 | return; |
340 | 326 | ||
341 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, | 327 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, |
342 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 328 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); |
343 | receiverIDs.Add(client.AgentId); | 329 | receiverIDs.Add(client.AgentId); |
344 | } | 330 | } |
@@ -355,20 +341,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
355 | /// <param name="fromPos"></param> | 341 | /// <param name="fromPos"></param> |
356 | /// <param name="regionPos">/param> | 342 | /// <param name="regionPos">/param> |
357 | /// <param name="fromAgentID"></param> | 343 | /// <param name="fromAgentID"></param> |
358 | /// <param name='ownerID'> | ||
359 | /// Owner of the message. For at least some messages from objects, this has to be correctly filled with the owner's UUID. | ||
360 | /// This is the case for script error messages in viewer 3 since LLViewer change EXT-7762 | ||
361 | /// </param> | ||
362 | /// <param name="fromName"></param> | 344 | /// <param name="fromName"></param> |
363 | /// <param name="type"></param> | 345 | /// <param name="type"></param> |
364 | /// <param name="message"></param> | 346 | /// <param name="message"></param> |
365 | /// <param name="src"></param> | 347 | /// <param name="src"></param> |
366 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a | 348 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a |
367 | /// precondition</returns> | 349 | /// precondition</returns> |
368 | protected virtual bool TrySendChatMessage( | 350 | protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, |
369 | ScenePresence presence, Vector3 fromPos, Vector3 regionPos, | 351 | UUID fromAgentID, string fromName, ChatTypeEnum type, |
370 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, | 352 | string message, ChatSourceType src) |
371 | string message, ChatSourceType src, bool ignoreDistance) | ||
372 | { | 353 | { |
373 | // don't send chat to child agents | 354 | // don't send chat to child agents |
374 | if (presence.IsChildAgent) return false; | 355 | if (presence.IsChildAgent) return false; |
@@ -388,9 +369,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
388 | } | 369 | } |
389 | 370 | ||
390 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView | 371 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView |
391 | presence.ControllingClient.SendChatMessage( | 372 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, |
392 | message, (byte) type, fromPos, fromName, | 373 | fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully); |
393 | fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); | ||
394 | 374 | ||
395 | return true; | 375 | return true; |
396 | } | 376 | } |