diff options
author | onefang | 2019-05-19 22:33:38 +1000 |
---|---|---|
committer | onefang | 2019-05-19 22:33:38 +1000 |
commit | 5ec8bd3771b7e4e38834eb93c7bd854ee0c9fc2e (patch) | |
tree | 60db330f8bea03112669909231c6795c23da7f80 /OpenSim/Region/OptionalModules | |
parent | Clean up maptile directory creation code. (diff) | |
download | opensim-SC-5ec8bd3771b7e4e38834eb93c7bd854ee0c9fc2e.zip opensim-SC-5ec8bd3771b7e4e38834eb93c7bd854ee0c9fc2e.tar.gz opensim-SC-5ec8bd3771b7e4e38834eb93c7bd854ee0c9fc2e.tar.bz2 opensim-SC-5ec8bd3771b7e4e38834eb93c7bd854ee0c9fc2e.tar.xz |
Various IRC fixes.
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs | 39 |
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 |