mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Replace url of link with new one from json.
This commit is contained in:
parent
83dce820d8
commit
fe24d09009
|
@ -22,10 +22,11 @@ void LinkResolver::getLinkInfo(const QString url,
|
||||||
QString response = QString();
|
QString response = QString();
|
||||||
if (statusCode == 200) {
|
if (statusCode == 200) {
|
||||||
response = root.value("tooltip").toString();
|
response = root.value("tooltip").toString();
|
||||||
|
url = root.value("link").toString();
|
||||||
} else {
|
} else {
|
||||||
response = root.value("message").toString();
|
response = root.value("message").toString();
|
||||||
}
|
}
|
||||||
successCallback(QUrl::fromPercentEncoding(response.toUtf8()));
|
successCallback(QUrl::fromPercentEncoding(response.toUtf8()), url);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
});
|
});
|
||||||
|
|
|
@ -280,10 +280,13 @@ void TwitchMessageBuilder::addTextOrEmoji(const QString &string_)
|
||||||
->setLink(link);
|
->setLink(link);
|
||||||
|
|
||||||
LinkResolver::getLinkInfo(
|
LinkResolver::getLinkInfo(
|
||||||
linkString, [linkMELowercase, linkMEOriginal](QString tooltipText) {
|
linkString, [linkMELowercase, linkMEOriginal](QString tooltipText,
|
||||||
|
QString originalLink) {
|
||||||
if (!tooltipText.isEmpty()) {
|
if (!tooltipText.isEmpty()) {
|
||||||
linkMELowercase->setTooltip(tooltipText);
|
linkMELowercase->setTooltip(tooltipText)
|
||||||
linkMEOriginal->setTooltip(tooltipText);
|
->setLink(originalLink);
|
||||||
|
linkMEOriginal->setTooltip(tooltipText)
|
||||||
|
->setLink(originalLink);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue