From 47764c0397a51da2662021a781cefe29af46bf25 Mon Sep 17 00:00:00 2001 From: PKEv Date: Sun, 10 Apr 2016 17:36:25 +0300 Subject: [PATCH] feat(chatform): add support for non-local file and samba share links E.g. links like "file://192.168.1.1/" and "smb://localnode/" are now supported. Before only links to local files were supported, e.g. "file:///local/file.txt" --- src/chatlog/chatmessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index c2a563b4f..8ed5809f2 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -249,7 +249,7 @@ QString ChatMessage::detectAnchors(const QString &str) "(?:\\b)((www\\.)|(http[s]?|ftp)://)" // (protocol)://(printable - non-special character) // http://ONEORMOREALHPA-DIGIT "\\w+\\S+)" // any other character, lets domains and other - "|(?:\\b)(file:///)([\\S| ]*)" //link to a local file, valid until the end of the line + "|(?:\\b)((file|smb)://)([\\S| ]*)" //link to a local file, valid until the end of the line "|(?:\\b)(tox:[a-zA-Z\\d]{76})" //link with full user address "|(?:\\b)(mailto:\\S+@\\S+\\.\\S+)" //@mail link "|(?:\\b)(tox:\\S+@\\S+)"); // starts with `tox` then : and only alpha-digits till the end