[smuxi/experiments/any_server_support: 17/34] Engine(-Tests): don't match upper-case letters in domain and TLD for heuristic links



commit ce34de35fa6749d03f2650526468a258570ca2fb
Author: Mirco Bauer <meebey meebey net>
Date:   Tue Jan 21 07:33:49 2014 +0100

    Engine(-Tests): don't match upper-case letters in domain and TLD for heuristic links
    
    E.g. ServiceStack.Common FSharp.Compiler

 src/Engine-Tests/MessageBuilderTests.cs     |   10 ++++++++++
 src/Engine/Config/MessageBuilderSettings.cs |    3 +--
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs
index 9c45ca6..53093cd 100644
--- a/src/Engine-Tests/MessageBuilderTests.cs
+++ b/src/Engine-Tests/MessageBuilderTests.cs
@@ -554,6 +554,16 @@ namespace Smuxi.Engine
         }
 
         [Test]
+        public void AppendMessageWithNonUrls()
+        {
+            var msg = "ServiceStack.Common";
+            var builder = new MessageBuilder();
+            builder.TimeStamp = DateTime.MinValue;
+            builder.Append(new TextMessagePartModel("ServiceStack.Common"));
+            TestMessage(msg, builder.ToMessage());
+        }
+
+        [Test]
         public void AppendBrokenMail()
         {
             var msg = "mailto:/larry google com";
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index 17076fa..b0ed78f 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -112,8 +112,7 @@ namespace Smuxi.Engine
             // Gst.Buffer.Unref() from matching
             string heuristic_domain = @"(?:(?:" + subdomain + ")+(?:" + common_tld + ")|localhost)";
             string heuristic_address = heuristic_domain + "(?:" + path + ")?";
-            regex = new Regex(heuristic_address,
-                              RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            regex = new Regex(heuristic_address, RegexOptions.Compiled);
             BuiltinSmartLinks.Add(new SmartLink(regex) {
                 LinkFormat = "http://{0}";
             });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]