diff --git a/src/messages/messagebuilder.cpp b/src/messages/messagebuilder.cpp index e4d85e6fb..215e89d71 100644 --- a/src/messages/messagebuilder.cpp +++ b/src/messages/messagebuilder.cpp @@ -79,7 +79,7 @@ QString MessageBuilder::matchLink(const QString &string) "$"; static QRegularExpression linkRegex(urlRegExp, QRegularExpression::CaseInsensitiveOption); - + static QRegularExpression httpRegex("\\bhttps?://"); auto match = linkRegex.match(string); if (!match.hasMatch()) { @@ -88,6 +88,10 @@ QString MessageBuilder::matchLink(const QString &string) QString captured = match.captured(); + if (!captured.contains(httpRegex)) { + captured.insert(0, "http://"); + } + return captured; }