[smuxi] Engine(-Tests): fixed parsing IRC URIs like irc://freenode/smuxi
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi] Engine(-Tests): fixed parsing IRC URIs like irc://freenode/smuxi
- Date: Fri, 30 Jan 2015 12:21:41 +0000 (UTC)
commit acb7126a0f70be9729f42114b7e2de667363abf8
Author: Mirco Bauer <meebey meebey net>
Date: Fri Jan 30 13:19:54 2015 +0100
Engine(-Tests): fixed parsing IRC URIs like irc://freenode/smuxi
IRC network names do not contain any . like DNS names do, thus we need to
allow bare hostnames.
src/Engine-Tests/MessageBuilderTests.cs | 8 +++++++-
src/Engine/Config/MessageBuilderSettings.cs | 5 +++--
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs
index 9d481e9..094cd51 100644
--- a/src/Engine-Tests/MessageBuilderTests.cs
+++ b/src/Engine-Tests/MessageBuilderTests.cs
@@ -1,6 +1,6 @@
// Smuxi - Smart MUltipleXed Irc
//
-// Copyright (c) 2013-2014 Mirco Bauer <meebey meebey net>
+// Copyright (c) 2013-2015 Mirco Bauer <meebey meebey net>
//
// Full GPL License: <http://www.gnu.org/licenses/gpl.txt>
//
@@ -559,6 +559,12 @@ namespace Smuxi.Engine
builder.TimeStamp = DateTime.MinValue;
builder.Append(new
UrlMessagePartModel("https://web.archive.org/web/20050208144213/http://www.jaganelli.de/"));
TestMessage(msg, builder.ToMessage());
+
+ msg = "irc://freenode/smuxi";
+ builder = new MessageBuilder();
+ builder.TimeStamp = DateTime.MinValue;
+ builder.Append(new UrlMessagePartModel(msg));
+ TestMessage(msg, builder.ToMessage());
}
[Test]
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index 18ac096..c58bec5 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -1,6 +1,6 @@
// Smuxi - Smart MUltipleXed Irc
//
-// Copyright (c) 2011, 2014 Mirco Bauer <meebey meebey net>
+// Copyright (c) 2011, 2014-2015 Mirco Bauer <meebey meebey net>
//
// Full GPL License: <http://www.gnu.org/licenses/gpl.txt>
//
@@ -80,7 +80,8 @@ namespace Smuxi.Engine
string ip4 = @"(?:[0-9]{1,3}\.){3}[0-9]{1,3}";
string ip = "(?:" + ip4 + "|" + ip6 + "|" + quoted_ip6 + ")";
string domain = @"(?:(?:" + subdomain + ")+(?:" + any_tld + ")|localhost)";
- string host = "(?:" + domain + "|" + ip + ")";
+ string bare_host = @"[a-z]+";
+ string host = "(?:" + domain + "|" + bare_host + "|" + ip + ")";
string short_number = "[1-9][0-9]{,4}";
string port = ":" + short_number;
string user = "[a-z0-9._%+-]+@";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]