made links open in incognito by default for hemirt

This commit is contained in:
fourtf 2018-10-16 16:34:09 +02:00
parent db4034d2d9
commit 2840b38e91

View file

@ -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); });