From 2840b38e91d401d5116bca1494ff3112d7593057 Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 16 Oct 2018 16:34:09 +0200 Subject: [PATCH] made links open in incognito by default for hemirt --- src/widgets/helper/ChannelView.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 52264c511..41a428925 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1221,8 +1221,16 @@ void ChannelView::addContextMenuItems( if (hoveredElement->getLink().type == Link::Url) { QString url = hoveredElement->getLink().value; - menu->addAction("Open link", - [url] { QDesktopServices::openUrl(QUrl(url)); }); + // open link + bool incognitoByDefault = supportsIncognitoLinks() && + layout->getMessage()->loginName == "hemirt"; + menu->addAction("Open link", [url, incognitoByDefault] { + if (incognitoByDefault) + openLinkIncognito(url); + else + QDesktopServices::openUrl(QUrl(url)); + }); + // open link default if (supportsIncognitoLinks()) { menu->addAction("Open link incognito", [url] { openLinkIncognito(url); });