Add support for spotify hyperlinking (#597)

* Add support for spotify hyperlinking

* Change open link in browser to open link
This commit is contained in:
Lajamerr Mittesdine
2018-07-11 07:50:05 -04:00
committed by fourtf
parent 77f904fae4
commit 727ccd2ff4
3 changed files with 14 additions and 8 deletions
+3 -4
View File
@@ -49,6 +49,7 @@ QString MessageBuilder::matchLink(const QString &string)
static QRegularExpression httpRegex("\\bhttps?://", QRegularExpression::CaseInsensitiveOption);
static QRegularExpression ftpRegex("\\bftps?://", QRegularExpression::CaseInsensitiveOption);
static QRegularExpression spotifyRegex("\\bspotify:", QRegularExpression::CaseInsensitiveOption);
if (!linkParser.hasMatch()) {
return QString();
@@ -56,10 +57,8 @@ QString MessageBuilder::matchLink(const QString &string)
QString captured = linkParser.getCaptured();
if (!captured.contains(httpRegex)) {
if (!captured.contains(ftpRegex)) {
captured.insert(0, "http://");
}
if (!captured.contains(httpRegex) && !captured.contains(ftpRegex) && !captured.contains(spotifyRegex)) {
captured.insert(0, "http://");
}
return captured;