From 81e5cf14ceb309b8e160389368883dad683bc74a Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 22 Oct 2007 16:55:03 +0000 Subject: [PATCH] after a small misunderstanding with the match group numbers IRC relay mode now has much more sensible broadcast messages in world and ignores non PRIVMSG commands --- OpenSim/Region/Environment/Modules/ChatModule.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index f60b5ff81a..bba335bc8a 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -326,14 +326,17 @@ namespace OpenSim.Region.Environment.Modules Regex RE = new Regex(regex, RegexOptions.Multiline); MatchCollection matches = RE.Matches(input); // Get some direct matches $1 $4 is a - if ((matches.Count == 1) && (matches[0].Groups.Count == 4)) { + if ((matches.Count == 1) && (matches[0].Groups.Count == 5)) { result = new Dictionary(); - result.Add("nick", matches[0].Groups[0].Value); - result.Add("user", matches[0].Groups[1].Value); - result.Add("channel", matches[0].Groups[2].Value); - result.Add("msg", matches[0].Groups[3].Value); + result.Add("nick", matches[0].Groups[1].Value); + result.Add("user", matches[0].Groups[2].Value); + result.Add("channel", matches[0].Groups[3].Value); + result.Add("msg", matches[0].Groups[4].Value); } else { m_log.Verbose("IRC", "Number of matches: " + matches.Count); + if (matches.Count > 0) { + m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count); + } } return result; }