mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Show IV button only if supported.
This commit is contained in:
parent
d43f0be0da
commit
e20770e256
5 changed files with 27 additions and 3 deletions
Telegram
|
@ -172,7 +172,7 @@ WebPageType ParseWebPageType(
|
|||
}
|
||||
|
||||
bool IgnoreIv(WebPageType type) {
|
||||
return (type == WebPageType::Message);
|
||||
return !Iv::ShowButton() || (type == WebPageType::Message);
|
||||
}
|
||||
|
||||
WebPageType ParseWebPageType(const MTPDwebPage &page) {
|
||||
|
|
|
@ -8,11 +8,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "iv/iv_data.h"
|
||||
|
||||
#include "iv/iv_prepare.h"
|
||||
#include "webview/webview_interface.h"
|
||||
|
||||
#include <QtCore/QRegularExpression>
|
||||
#include <QtCore/QUrl>
|
||||
|
||||
namespace Iv {
|
||||
namespace {
|
||||
|
||||
bool FailureRecorded/* = false*/;
|
||||
|
||||
} // namespace
|
||||
|
||||
QByteArray GeoPointId(Geo point) {
|
||||
const auto lat = int(point.lat * 1000000);
|
||||
|
@ -89,4 +95,17 @@ QString SiteNameFromUrl(const QString &url) {
|
|||
return QString();
|
||||
}
|
||||
|
||||
bool ShowButton() {
|
||||
static const auto Supported = Webview::NavigateToDataSupported();
|
||||
return Supported;
|
||||
}
|
||||
|
||||
void RecordShowFailure() {
|
||||
FailureRecorded = true;
|
||||
}
|
||||
|
||||
bool FailedToShow() {
|
||||
return FailureRecorded;
|
||||
}
|
||||
|
||||
} // namespace Iv
|
||||
|
|
|
@ -53,4 +53,9 @@ private:
|
|||
|
||||
[[nodiscard]] QString SiteNameFromUrl(const QString &url);
|
||||
|
||||
[[nodiscard]] bool ShowButton();
|
||||
|
||||
void RecordShowFailure();
|
||||
[[nodiscard]] bool FailedToShow();
|
||||
|
||||
} // namespace Iv
|
||||
|
|
|
@ -1060,4 +1060,4 @@ boostsMessageIcon: icon {{ "stories/boosts_mini", windowFg }};
|
|||
boostsMessageIconPadding: margins(0px, 2px, 0px, 0px);
|
||||
|
||||
historyIvIcon: icon{{ "boosts/boost_mini2", windowFg }};
|
||||
historyIvIconPadding: margins(2px, 3px, 2px, 0px);
|
||||
historyIvIconPadding: margins(2px, 2px, 2px, 0px);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit fbf9dd54787df90c98cf230cb53323527e0b0639
|
||||
Subproject commit cf8ef94d0b12f8484e247d6a2d88dd1c11a6b964
|
Loading…
Add table
Reference in a new issue