Add hifi:// clickable links to chat

The handling also needed to be updated to handle domains correctly -
just routing to goToURL instead of gTo fixes this.
This commit is contained in:
Ryan Huffman 2014-05-08 07:54:49 -07:00
parent 6762d4d63c
commit fdaa42b219
2 changed files with 2 additions and 4 deletions

View file

@ -984,9 +984,7 @@ void Menu::goToUser(const QString& user) {
/// Open a url, shortcutting any "hifi" scheme URLs to the local application.
void Menu::openUrl(const QUrl& url) {
if (url.scheme() == "hifi") {
QString path = url.toString(QUrl::RemoveScheme);
path = path.remove(QRegExp("^:?/*"));
goTo(path);
goToURL(url.toString());
} else {
QDesktopServices::openUrl(url);
}

View file

@ -30,7 +30,7 @@
const int NUM_MESSAGES_TO_TIME_STAMP = 20;
const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?))://\\S+)");
const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)");
const QRegularExpression regexHifiLinks("([#@]\\S+)");
const QString mentionSoundsPath("/sounds/mention/");
const QString mentionRegex("@(\\b%1\\b)");