Added setting to disable auto unshort links.

This commit is contained in:
23rd 2018-09-06 17:59:49 +03:00
parent 5f19a57f5a
commit 0d8b5cad63
3 changed files with 8 additions and 1 deletions

View file

@ -3,6 +3,7 @@
#include "common/Common.hpp"
#include "common/NetworkRequest.hpp"
#include "messages/Link.hpp"
#include "singletons/Settings.hpp"
#include <QString>
@ -24,7 +25,9 @@ void LinkResolver::getLinkInfo(const QString url,
QString linkString = url;
if (statusCode == 200) {
response = root.value("tooltip").toString();
linkString = root.value("link").toString();
if (getSettings()->enableUnshortLinks) {
linkString = root.value("link").toString();
}
} else {
response = root.value("message").toString();
}

View file

@ -104,6 +104,7 @@ public:
/// Links
BoolSetting linksDoubleClickOnly = {"/links/doubleClickToOpen", false};
BoolSetting enableLinkInfoTooltip = {"/links/linkInfoTooltip", false};
BoolSetting enableUnshortLinks = {"/links/unshortLinks", false};
BoolSetting enableLowercaseLink = {"/links/linkLowercase", true};
/// Ingored Users

View file

@ -53,6 +53,9 @@ FeelPage::FeelPage()
form->addRow("",
this->createCheckBox("Show link info in tooltips",
getSettings()->enableLinkInfoTooltip));
form->addRow("",
this->createCheckBox("Auto unshort links (requires restart)",
getSettings()->enableUnshortLinks));
}
layout->addSpacing(16);