aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs39
1 files changed, 23 insertions, 16 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
index a3ef83b..eedc47b 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
@@ -389,29 +389,36 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
389 } 389 }
390 390
391 m_log.DebugFormat("[IRC-Region {0}] heard on channel {1} : {2}", Region, msg.Channel, msg.Message); 391 m_log.DebugFormat("[IRC-Region {0}] heard on channel {1} : {2}", Region, msg.Channel, msg.Message);
392 string txt = msg.Message;
392 393
393 if (null != avatar && cs.RelayChat && (msg.Channel == 0 || msg.Channel == DEBUG_CHANNEL)) 394 if (null != avatar)
394 { 395 {
395 string txt = msg.Message; 396 if ((!cs.RelayChat) || (msg.Channel != 0 && msg.Channel != DEBUG_CHANNEL))
396 if (txt.StartsWith("/me ")) 397 return;
397 txt = String.Format("{0} {1}", fromName, msg.Message.Substring(4));
398
399 cs.irc.PrivMsg(cs.PrivateMessageFormat, fromName, Region, txt);
400 return;
401 } 398 }
402 399 else
403 if (null == avatar && cs.RelayPrivateChannels && null != cs.AccessPassword &&
404 msg.Channel == cs.RelayChannelOut)
405 { 400 {
406 Match m = cs.AccessPasswordRegex.Match(msg.Message); 401 if (cs.RelayPrivateChannels && msg.Channel == cs.RelayChannelOut)
407 if (null != m)
408 { 402 {
409 m_log.DebugFormat("[IRC] relaying message from {0}: {1}", m.Groups["avatar"].ToString(), 403 if (null != cs.AccessPassword)
410 m.Groups["message"].ToString()); 404 {
411 cs.irc.PrivMsg(cs.PrivateMessageFormat, m.Groups["avatar"].ToString(), 405 Match m = cs.AccessPasswordRegex.Match(msg.Message);
412 scene.RegionInfo.RegionName, m.Groups["message"].ToString()); 406 if (null != m)
407 {
408 if (m.Groups["avatar"].ToString() != "")
409 fromName = m.Groups["avatar"].ToString();
410 if (m.Groups["message"].ToString() != "")
411 txt = m.Groups["message"].ToString();
412 }
413 }
413 } 414 }
415 fromName = "OBJECT: " + fromName;
414 } 416 }
417
418 if (txt.StartsWith("/me "))
419 txt = String.Format("{0} {1}", fromName, msg.Message.Substring(4));
420 m_log.DebugFormat("[IRC] relaying message from {0}: {1}", fromName, txt);
421 cs.irc.PrivMsg(cs.PrivateMessageFormat, fromName, Region, txt);
415 } 422 }
416 423
417 // This method gives the region an opportunity to interfere with 424 // This method gives the region an opportunity to interfere with