Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a5d8046d5 | ||
|
|
65a14bcab4 | ||
|
|
e9bb6f65e3 | ||
|
|
74f7fa80b7 | ||
|
|
2ff0ed50be | ||
|
|
281ad01b85 | ||
|
|
4864a6996f | ||
|
|
0af3028cd6 | ||
|
|
11c91c1a42 | ||
|
|
7f3dc27aa9 | ||
|
|
51fc104c60 | ||
|
|
6b96466c5e | ||
|
|
7c1510b611 | ||
|
|
993c0ee648 | ||
|
|
503c3c7b00 |
@@ -5318,6 +5318,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_iv_join_channel" = "Join";
|
||||
"lng_iv_window_title" = "Instant View";
|
||||
"lng_iv_wrong_layout" = "Wrong layout?";
|
||||
"lng_iv_not_supported" = "This link appears to be invalid.";
|
||||
|
||||
"lng_limit_download_title" = "Download speed limited";
|
||||
"lng_limit_download_subscribe" = "Subscribe to {link} and increase download speed {increase}.";
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
|
||||
ProcessorArchitecture="ARCHITECTURE"
|
||||
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
|
||||
Version="5.3.0.0" />
|
||||
Version="5.3.1.0" />
|
||||
<Properties>
|
||||
<DisplayName>Telegram Desktop</DisplayName>
|
||||
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
|
||||
|
||||
@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 5,3,0,0
|
||||
PRODUCTVERSION 5,3,0,0
|
||||
FILEVERSION 5,3,1,0
|
||||
PRODUCTVERSION 5,3,1,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -62,10 +62,10 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||
VALUE "FileDescription", "Telegram Desktop"
|
||||
VALUE "FileVersion", "5.3.0.0"
|
||||
VALUE "FileVersion", "5.3.1.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "5.3.0.0"
|
||||
VALUE "ProductVersion", "5.3.1.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 5,3,0,0
|
||||
PRODUCTVERSION 5,3,0,0
|
||||
FILEVERSION 5,3,1,0
|
||||
PRODUCTVERSION 5,3,1,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -53,10 +53,10 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||
VALUE "FileDescription", "Telegram Desktop Updater"
|
||||
VALUE "FileVersion", "5.3.0.0"
|
||||
VALUE "FileVersion", "5.3.1.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "5.3.0.0"
|
||||
VALUE "ProductVersion", "5.3.1.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -1014,6 +1014,7 @@ void GiftPremiumValidator::showChoosePeerBox(const QString &ref) {
|
||||
if (users.empty()) {
|
||||
show->showToast(
|
||||
tr::lng_settings_gift_premium_choose(tr::now));
|
||||
return;
|
||||
}
|
||||
const auto giftBox = show->show(
|
||||
Box(GiftsBox, _controller, users, api, ref));
|
||||
|
||||
@@ -1414,8 +1414,15 @@ editTagLimit: FlatLabel(defaultFlatLabel) {
|
||||
}
|
||||
|
||||
editStickerSetNameField: InputField(defaultInputField) {
|
||||
textMargins: margins(0px, 28px, 26px, 4px);
|
||||
heightMax: 55px;
|
||||
textMargins: margins(0px, 8px, 26px, 4px);
|
||||
heightMin: 36px;
|
||||
heightMax: 36px;
|
||||
placeholderFg: placeholderFg;
|
||||
placeholderFgActive: placeholderFgActive;
|
||||
placeholderFgError: placeholderFgActive;
|
||||
placeholderMargins: margins(2px, 0px, 2px, 0px);
|
||||
placeholderScale: 0.;
|
||||
placeholderFont: normalFont;
|
||||
}
|
||||
editStickerSetNameLoading: InfiniteRadialAnimation(defaultInfiniteRadialAnimation) {
|
||||
color: lightButtonFg;
|
||||
|
||||
@@ -239,7 +239,7 @@ bool UiIntegration::handleUrlClick(
|
||||
Core::App().openLocalUrl(local, context);
|
||||
return true;
|
||||
} else if (local.startsWith(u"tonsite://"_q, Qt::CaseInsensitive)) {
|
||||
Core::App().iv().showTonSite(url, context);
|
||||
Core::App().iv().showTonSite(local, context);
|
||||
return true;
|
||||
} else if (local.startsWith(u"internal:"_q, Qt::CaseInsensitive)) {
|
||||
Core::App().openInternalUrl(local, context);
|
||||
|
||||
@@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;
|
||||
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
|
||||
constexpr auto AppName = "Telegram Desktop"_cs;
|
||||
constexpr auto AppFile = "Telegram"_cs;
|
||||
constexpr auto AppVersion = 5003000;
|
||||
constexpr auto AppVersionStr = "5.3";
|
||||
constexpr auto AppVersion = 5003001;
|
||||
constexpr auto AppVersionStr = "5.3.1";
|
||||
constexpr auto AppBetaVersion = false;
|
||||
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
|
||||
|
||||
@@ -53,6 +53,12 @@ std::optional<QString> OnlineTextSpecial(not_null<UserData*> user) {
|
||||
} else if (user->isSupport()) {
|
||||
return tr::lng_status_support(tr::now);
|
||||
} else if (user->isBot()) {
|
||||
if (const auto count = user->botInfo->activeUsers) {
|
||||
return tr::lng_bot_status_users(
|
||||
tr::now,
|
||||
lt_count_decimal,
|
||||
count);
|
||||
}
|
||||
return tr::lng_status_bot(tr::now);
|
||||
} else if (user->isServiceUser()) {
|
||||
return tr::lng_status_support(tr::now);
|
||||
|
||||
@@ -166,16 +166,17 @@ void FillEntryMenu(
|
||||
.icon = &st::menuIconDeleteAttention,
|
||||
.isAttention = true,
|
||||
});
|
||||
|
||||
add({
|
||||
.text = descriptor.removeAllText,
|
||||
.handler = RemoveAllConfirm(
|
||||
descriptor.controller,
|
||||
descriptor.removeAllConfirm,
|
||||
descriptor.removeAll),
|
||||
.icon = &st::menuIconCancelAttention,
|
||||
.isAttention = true,
|
||||
});
|
||||
if (!descriptor.removeAllText.isEmpty()) {
|
||||
add({
|
||||
.text = descriptor.removeAllText,
|
||||
.handler = RemoveAllConfirm(
|
||||
descriptor.controller,
|
||||
descriptor.removeAllConfirm,
|
||||
descriptor.removeAll),
|
||||
.icon = &st::menuIconCancelAttention,
|
||||
.isAttention = true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
RecentRow::RecentRow(not_null<PeerData*> peer)
|
||||
@@ -422,14 +423,21 @@ public:
|
||||
not_null<Window::SessionController*> window);
|
||||
|
||||
void prepare() override;
|
||||
base::unique_qptr<Ui::PopupMenu> rowContextMenu(
|
||||
QWidget *parent,
|
||||
not_null<PeerListRow*> row) override;
|
||||
|
||||
void load();
|
||||
|
||||
[[nodiscard]] rpl::producer<> refreshed() const;
|
||||
[[nodiscard]] bool shown(not_null<PeerData*> peer) const;
|
||||
|
||||
private:
|
||||
void appendRow(not_null<UserData*> bot);
|
||||
void fill();
|
||||
|
||||
std::vector<not_null<UserData*>> _bots;
|
||||
rpl::event_stream<> _refreshed;
|
||||
rpl::lifetime _lifetime;
|
||||
|
||||
};
|
||||
@@ -438,7 +446,9 @@ class PopularAppsController final
|
||||
: public Suggestions::ObjectListController {
|
||||
public:
|
||||
explicit PopularAppsController(
|
||||
not_null<Window::SessionController*> window);
|
||||
not_null<Window::SessionController*> window,
|
||||
Fn<bool(not_null<PeerData*>)> filterOut,
|
||||
rpl::producer<> filterOutRefreshes);
|
||||
|
||||
void prepare() override;
|
||||
|
||||
@@ -448,6 +458,8 @@ private:
|
||||
void fill();
|
||||
void appendRow(not_null<UserData*> bot);
|
||||
|
||||
Fn<bool(not_null<PeerData*>)> _filterOut;
|
||||
rpl::producer<> _filterOutRefreshes;
|
||||
History *_activeHistory = nullptr;
|
||||
bool _requested = false;
|
||||
rpl::lifetime _lifetime;
|
||||
@@ -1031,10 +1043,47 @@ void RecentAppsController::prepare() {
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
base::unique_qptr<Ui::PopupMenu> RecentAppsController::rowContextMenu(
|
||||
QWidget *parent,
|
||||
not_null<PeerListRow*> row) {
|
||||
auto result = base::make_unique_q<Ui::PopupMenu>(
|
||||
parent,
|
||||
st::popupMenuWithIcons);
|
||||
const auto peer = row->peer();
|
||||
const auto weak = base::make_weak(this);
|
||||
const auto session = &this->session();
|
||||
const auto removeOne = crl::guard(session, [=] {
|
||||
if (weak) {
|
||||
const auto rowId = peer->id.value;
|
||||
if (const auto row = delegate()->peerListFindRow(rowId)) {
|
||||
setCount(std::max(0, countCurrent() - 1));
|
||||
delegate()->peerListRemoveRow(row);
|
||||
delegate()->peerListRefreshRows();
|
||||
}
|
||||
}
|
||||
session->topBotApps().remove(peer);
|
||||
});
|
||||
FillEntryMenu(Ui::Menu::CreateAddActionCallback(result), {
|
||||
.controller = window(),
|
||||
.peer = peer,
|
||||
.removeOneText = tr::lng_recent_remove(tr::now),
|
||||
.removeOne = removeOne,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
void RecentAppsController::load() {
|
||||
session().topBotApps().reload();
|
||||
}
|
||||
|
||||
rpl::producer<> RecentAppsController::refreshed() const {
|
||||
return _refreshed.events();
|
||||
}
|
||||
|
||||
bool RecentAppsController::shown(not_null<PeerData*> peer) const {
|
||||
return delegate()->peerListFindRow(peer->id.value) != nullptr;
|
||||
}
|
||||
|
||||
void RecentAppsController::fill() {
|
||||
const auto count = countCurrent();
|
||||
const auto limit = expandedCurrent()
|
||||
@@ -1054,6 +1103,8 @@ void RecentAppsController::fill() {
|
||||
}
|
||||
}
|
||||
delegate()->peerListRefreshRows();
|
||||
|
||||
_refreshed.fire({});
|
||||
}
|
||||
|
||||
void RecentAppsController::appendRow(not_null<UserData*> bot) {
|
||||
@@ -1066,13 +1117,21 @@ void RecentAppsController::appendRow(not_null<UserData*> bot) {
|
||||
}
|
||||
|
||||
PopularAppsController::PopularAppsController(
|
||||
not_null<Window::SessionController*> window)
|
||||
: ObjectListController(window) {
|
||||
not_null<Window::SessionController*> window,
|
||||
Fn<bool(not_null<PeerData*>)> filterOut,
|
||||
rpl::producer<> filterOutRefreshes)
|
||||
: ObjectListController(window)
|
||||
, _filterOut(std::move(filterOut))
|
||||
, _filterOutRefreshes(std::move(filterOutRefreshes)) {
|
||||
}
|
||||
|
||||
void PopularAppsController::prepare() {
|
||||
setupPlainDivider(tr::lng_bot_apps_popular());
|
||||
fill();
|
||||
rpl::single() | rpl::then(
|
||||
std::move(_filterOutRefreshes)
|
||||
) | rpl::start_with_next([=] {
|
||||
fill();
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
void PopularAppsController::load() {
|
||||
@@ -1089,13 +1148,13 @@ void PopularAppsController::load() {
|
||||
}
|
||||
|
||||
void PopularAppsController::fill() {
|
||||
const auto attachWebView = &session().attachWebView();
|
||||
const auto &list = attachWebView->popularAppBots();
|
||||
if (list.empty()) {
|
||||
return;
|
||||
while (delegate()->peerListFullRowsCount()) {
|
||||
delegate()->peerListRemoveRow(delegate()->peerListRowAt(0));
|
||||
}
|
||||
for (const auto &bot : list) {
|
||||
appendRow(bot);
|
||||
for (const auto &bot : session().attachWebView().popularAppBots()) {
|
||||
if (!_filterOut || !_filterOut(bot)) {
|
||||
appendRow(bot);
|
||||
}
|
||||
}
|
||||
delegate()->peerListRefreshRows();
|
||||
setCount(delegate()->peerListFullRowsCount());
|
||||
@@ -1103,10 +1162,10 @@ void PopularAppsController::fill() {
|
||||
|
||||
void PopularAppsController::appendRow(not_null<UserData*> bot) {
|
||||
auto row = std::make_unique<PeerListRow>(bot);
|
||||
if (const auto count = bot->botInfo->activeUsers) {
|
||||
row->setCustomStatus(
|
||||
tr::lng_bot_status_users(tr::now, lt_count_decimal, count));
|
||||
}
|
||||
//if (const auto count = bot->botInfo->activeUsers) {
|
||||
// row->setCustomStatus(
|
||||
// tr::lng_bot_status_users(tr::now, lt_count_decimal, count));
|
||||
//}
|
||||
delegate()->peerListAppendRow(std::move(row));
|
||||
}
|
||||
|
||||
@@ -1863,6 +1922,10 @@ auto Suggestions::setupRecommendations() -> std::unique_ptr<ObjectList> {
|
||||
auto Suggestions::setupRecentApps() -> std::unique_ptr<ObjectList> {
|
||||
const auto controller = lifetime().make_state<RecentAppsController>(
|
||||
_controller);
|
||||
_recentAppsShows = [=](not_null<PeerData*> peer) {
|
||||
return controller->shown(peer);
|
||||
};
|
||||
_recentAppsRefreshed = controller->refreshed();
|
||||
|
||||
auto result = setupObjectList(
|
||||
_appsScroll.get(),
|
||||
@@ -1919,7 +1982,9 @@ auto Suggestions::setupRecentApps() -> std::unique_ptr<ObjectList> {
|
||||
|
||||
auto Suggestions::setupPopularApps() -> std::unique_ptr<ObjectList> {
|
||||
const auto controller = lifetime().make_state<PopularAppsController>(
|
||||
_controller);
|
||||
_controller,
|
||||
_recentAppsShows,
|
||||
rpl::duplicate(_recentAppsRefreshed));
|
||||
|
||||
const auto addToScroll = [=] {
|
||||
const auto wrap = _recentApps->wrap;
|
||||
|
||||
@@ -189,6 +189,8 @@ private:
|
||||
const std::unique_ptr<Ui::ElasticScroll> _appsScroll;
|
||||
const not_null<Ui::VerticalLayout*> _appsContent;
|
||||
|
||||
rpl::producer<> _recentAppsRefreshed;
|
||||
Fn<bool(not_null<PeerData*>)> _recentAppsShows;
|
||||
const std::unique_ptr<ObjectList> _recentApps;
|
||||
const std::unique_ptr<ObjectList> _popularApps;
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ void PreviewWrap::paintEvent(QPaintEvent *e) {
|
||||
userpicTop,
|
||||
width(),
|
||||
st::msgPhotoSize);
|
||||
} else if (const auto info = item->originalHiddenSenderInfo()) {
|
||||
} else if (const auto info = item->displayHiddenSenderInfo()) {
|
||||
if (info->customUserpic.empty()) {
|
||||
info->emptyUserpic.paintCircle(
|
||||
p,
|
||||
|
||||
@@ -1117,9 +1117,10 @@ Webview::ThemeParams WebViewInstance::botThemeParams() {
|
||||
|
||||
bool WebViewInstance::botHandleLocalUri(QString uri, bool keepOpen) {
|
||||
const auto local = Core::TryConvertUrlToLocal(uri);
|
||||
if (uri == local || Core::InternalPassportLink(local)) {
|
||||
return local.startsWith(u"tg://"_q);
|
||||
} else if (!local.startsWith(u"tg://"_q, Qt::CaseInsensitive)) {
|
||||
if (Core::InternalPassportLink(local)) {
|
||||
return true;
|
||||
} else if (!local.startsWith(u"tg://"_q, Qt::CaseInsensitive)
|
||||
&& !local.startsWith(u"tonsite://"_q, Qt::CaseInsensitive)) {
|
||||
return false;
|
||||
}
|
||||
const auto bot = _bot;
|
||||
|
||||
@@ -44,6 +44,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QtGui/QWindow>
|
||||
#include <charconv>
|
||||
|
||||
#include <ada.h>
|
||||
|
||||
namespace Iv {
|
||||
namespace {
|
||||
|
||||
@@ -137,50 +139,62 @@ namespace {
|
||||
|
||||
[[nodiscard]] QString TonsiteToHttps(QString value) {
|
||||
const auto ChangeHost = [](QString tonsite) {
|
||||
const auto fake = "http://" + tonsite.toStdString();
|
||||
const auto parsed = ada::parse<ada::url>(fake);
|
||||
if (!parsed) {
|
||||
return QString();
|
||||
}
|
||||
tonsite = QString::fromStdString(parsed->get_hostname());
|
||||
tonsite = tonsite.replace('-', "-h");
|
||||
tonsite = tonsite.replace('.', "-d");
|
||||
return tonsite + ".magic.org";
|
||||
};
|
||||
auto parsed = QUrl(value);
|
||||
if (parsed.isValid()) {
|
||||
parsed.setScheme("https");
|
||||
parsed.setHost(ChangeHost(parsed.host()));
|
||||
if (parsed.path().isEmpty()) {
|
||||
parsed.setPath(u"/"_q);
|
||||
}
|
||||
return parsed.toString();
|
||||
const auto prefix = u"tonsite://"_q;
|
||||
if (!value.toLower().startsWith(prefix)) {
|
||||
return QString();
|
||||
}
|
||||
const auto part = value.mid(u"tonsite://"_q.size());
|
||||
const auto part = value.mid(prefix.size());
|
||||
const auto split = part.indexOf('/');
|
||||
return "https://"
|
||||
+ ChangeHost((split < 0) ? part : part.left(split))
|
||||
+ ((split < 0) ? u"/"_q : part.mid(split));
|
||||
const auto host = ChangeHost((split < 0) ? part : part.left(split));
|
||||
if (host.isEmpty()) {
|
||||
return QString();
|
||||
}
|
||||
return "https://" + host + ((split < 0) ? u"/"_q : part.mid(split));
|
||||
}
|
||||
|
||||
[[nodiscard]] QString HttpsToTonsite(QString value) {
|
||||
const auto ChangeHost = [](QString https) {
|
||||
https.replace(".magic.org", QString());
|
||||
const auto dot = https.indexOf('.');
|
||||
if (dot < 0 || https.mid(dot).toLower() != u".magic.org"_q) {
|
||||
return QString();
|
||||
}
|
||||
https = https.mid(0, dot);
|
||||
https = https.replace("-d", ".");
|
||||
https = https.replace("-h", "-");
|
||||
return https;
|
||||
auto parts = https.split('.');
|
||||
for (auto &part : parts) {
|
||||
if (part.startsWith(u"xn--"_q)) {
|
||||
const auto utf8 = part.mid(4).toStdString();
|
||||
auto out = std::u32string();
|
||||
if (ada::idna::punycode_to_utf32(utf8, out)) {
|
||||
part = QString::fromUcs4(out.data(), out.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
return parts.join('.');
|
||||
};
|
||||
auto parsed = QUrl(value);
|
||||
if (parsed.isValid()) {
|
||||
const auto host = ChangeHost(parsed.host());
|
||||
const auto emptyPath = parsed.path().isEmpty();
|
||||
parsed.setScheme("tonsite");
|
||||
parsed.setHost(host);
|
||||
if (emptyPath) {
|
||||
parsed.setPath(u"/"_q);
|
||||
}
|
||||
if (parsed.isValid()) {
|
||||
return parsed.toString();
|
||||
}
|
||||
const auto prefix = u"https://"_q;
|
||||
if (!value.toLower().startsWith(prefix)) {
|
||||
return value;
|
||||
}
|
||||
const auto part = value.mid(u"https://"_q.size());
|
||||
const auto part = value.mid(prefix.size());
|
||||
const auto split = part.indexOf('/');
|
||||
const auto host = ChangeHost((split < 0) ? part : part.left(split));
|
||||
if (host.isEmpty()) {
|
||||
return value;
|
||||
}
|
||||
return "tonsite://"
|
||||
+ ChangeHost((split < 0) ? part : part.left(split))
|
||||
+ host
|
||||
+ ((split < 0) ? u"/"_q : part.mid(split));
|
||||
}
|
||||
|
||||
@@ -257,10 +271,15 @@ void Controller::initControls() {
|
||||
_subtitleText.value(),
|
||||
st::ivSubtitle);
|
||||
_subtitle->setSelectable(true);
|
||||
_subtitleText.value(
|
||||
) | rpl::start_with_next([=](const QString &subtitle) {
|
||||
|
||||
_windowTitleText = _subtitleText.value(
|
||||
) | rpl::map([=](const QString &subtitle) {
|
||||
const auto prefix = tr::lng_iv_window_title(tr::now);
|
||||
_window->setWindowTitle(prefix + ' ' + QChar(0x2014) + ' ' + subtitle);
|
||||
return prefix + ' ' + QChar(0x2014) + ' ' + subtitle;
|
||||
});
|
||||
_windowTitleText.value(
|
||||
) | rpl::start_with_next([=](const QString &title) {
|
||||
_window->setWindowTitle(title);
|
||||
}, _subtitle->lifetime());
|
||||
|
||||
_menuToggle.create(_subtitleWrap.get(), st::ivMenuToggle);
|
||||
@@ -337,10 +356,16 @@ void Controller::update(Prepared page) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Controller::IsGoodTonSiteUrl(const QString &uri) {
|
||||
return !TonsiteToHttps(uri).isEmpty();
|
||||
}
|
||||
|
||||
void Controller::showTonSite(
|
||||
const Webview::StorageId &storageId,
|
||||
QString uri) {
|
||||
const auto url = TonsiteToHttps(uri);
|
||||
Assert(!url.isEmpty());
|
||||
|
||||
if (!_webview) {
|
||||
createWebview(storageId);
|
||||
}
|
||||
@@ -355,6 +380,7 @@ void Controller::showTonSite(
|
||||
}) | rpl::map([=](QString value) {
|
||||
return HttpsToTonsite(value);
|
||||
});
|
||||
_windowTitleText = _subtitleText.value();
|
||||
_menuToggle->hide();
|
||||
}
|
||||
|
||||
@@ -488,7 +514,12 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
|
||||
}, _container->lifetime());
|
||||
|
||||
raw->setNavigationStartHandler([=](const QString &uri, bool newWindow) {
|
||||
return true;
|
||||
if (uri.startsWith(u"http://desktop-app-resource/"_q)
|
||||
|| QUrl(uri).host().toLower().endsWith(u".magic.org"_q)) {
|
||||
return true;
|
||||
}
|
||||
_events.fire({ .type = Event::Type::OpenLink, .url = uri });
|
||||
return false;
|
||||
});
|
||||
raw->setNavigationDoneHandler([=](bool success) {
|
||||
});
|
||||
@@ -578,7 +609,8 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
|
||||
|| index >= _pages.size()) {
|
||||
return Webview::DataResult::Failed;
|
||||
}
|
||||
return finishWith(WrapPage(_pages[index]), "text/html; charset=utf-8");
|
||||
return finishWith(
|
||||
WrapPage(_pages[index]), "text/html; charset=utf-8");
|
||||
} else if (id.starts_with("page") && id.ends_with(".json")) {
|
||||
auto index = 0;
|
||||
const auto result = std::from_chars(
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
base::flat_map<QByteArray, rpl::producer<bool>> inChannelValues);
|
||||
void update(Prepared page);
|
||||
|
||||
[[nodiscard]] static bool IsGoodTonSiteUrl(const QString &uri);
|
||||
void showTonSite(const Webview::StorageId &storageId, QString uri);
|
||||
|
||||
[[nodiscard]] bool active() const;
|
||||
@@ -132,6 +133,7 @@ private:
|
||||
std::unique_ptr<Ui::RpWidget> _subtitleWrap;
|
||||
rpl::variable<QString> _url;
|
||||
rpl::variable<QString> _subtitleText;
|
||||
rpl::variable<QString> _windowTitleText;
|
||||
std::unique_ptr<Ui::FlatLabel> _subtitle;
|
||||
Ui::Animations::Simple _subtitleBackShift;
|
||||
Ui::Animations::Simple _subtitleForwardShift;
|
||||
|
||||
@@ -42,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/layers/layer_widget.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/basic_click_handlers.h"
|
||||
#include "webview/webview_data_stream_memory.h"
|
||||
#include "webview/webview_interface.h"
|
||||
@@ -1074,7 +1075,10 @@ void Instance::openWithIvPreferred(
|
||||
void Instance::showTonSite(
|
||||
const QString &uri,
|
||||
QVariant context) {
|
||||
if (Platform::IsMac()) {
|
||||
if (!Controller::IsGoodTonSiteUrl(uri)) {
|
||||
Ui::Toast::Show(tr::lng_iv_not_supported(tr::now));
|
||||
return;
|
||||
} else if (Platform::IsMac()) {
|
||||
// Otherwise IV is not visible under the media viewer.
|
||||
Core::App().hideMediaView();
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ void PortalAutostart(bool enabled, Fn<void(bool)> done) {
|
||||
|
||||
auto &raw = **window;
|
||||
raw.setAttribute(Qt::WA_DontShowOnScreen);
|
||||
raw.setWindowFlag(Qt::Window);
|
||||
raw.setWindowModality(Qt::WindowModal);
|
||||
raw.show();
|
||||
|
||||
|
||||
@@ -801,6 +801,18 @@ RUN cmake --build out --config Debug --parallel \
|
||||
&& find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \;
|
||||
{%- endif %}
|
||||
|
||||
FROM builder AS ada
|
||||
RUN git clone -b v2.9.0 --depth=1 {{ GIT }}/ada-url/ada.git \
|
||||
&& cd ada \
|
||||
&& cmake -GNinja -B build . \
|
||||
-D CMAKE_BUILD_TYPE=None \
|
||||
-D ADA_TESTING=OFF \
|
||||
-D ADA_TOOLS=OFF \
|
||||
&& cmake --build build --parallel \
|
||||
&& DESTDIR="{{ LibrariesPath }}/ada-cache" cmake --install build \
|
||||
&& cd .. \
|
||||
&& rm -rf ada
|
||||
|
||||
FROM builder
|
||||
COPY --link --from=zlib {{ LibrariesPath }}/zlib-cache /
|
||||
COPY --link --from=xz {{ LibrariesPath }}/xz-cache /
|
||||
@@ -844,6 +856,7 @@ COPY --link --from=breakpad {{ LibrariesPath }}/breakpad-cache /
|
||||
COPY --link --from=webrtc {{ LibrariesPath }}/tg_owt tg_owt
|
||||
COPY --link --from=webrtc_release {{ LibrariesPath }}/tg_owt/out/Release tg_owt/out/Release
|
||||
COPY --link --from=libwebp {{ LibrariesPath }}/libwebp-cache /
|
||||
COPY --link --from=ada {{ LibrariesPath }}/ada-cache /
|
||||
|
||||
{%- if DEBUG %}
|
||||
COPY --link --from=webrtc_debug {{ LibrariesPath }}/tg_owt/out/Debug tg_owt/out/Debug
|
||||
|
||||
@@ -1831,6 +1831,30 @@ release:
|
||||
lipo -create Release.arm64/libtg_owt.a Release.x86_64/libtg_owt.a -output Release/libtg_owt.a
|
||||
""")
|
||||
|
||||
stage('ada', """
|
||||
git clone -b v2.9.0 https://github.com/ada-url/ada.git
|
||||
cd ada
|
||||
win:
|
||||
cmake -B out . ^
|
||||
-A %WIN32X64% ^
|
||||
-D ADA_TESTING=OFF ^
|
||||
-D ADA_TOOLS=OFF ^
|
||||
-D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" ^
|
||||
-D CMAKE_C_FLAGS_DEBUG="/MTd /Zi /Ob0 /Od /RTC1" ^
|
||||
-D CMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG"
|
||||
cmake --build out --config Debug --parallel
|
||||
cmake --build out --config Release --parallel
|
||||
mac:
|
||||
CFLAGS="$UNGUARDED" CPPFLAGS="$UNGUARDED" cmake -B build . \\
|
||||
-D ADA_TESTING=OFF \\
|
||||
-D ADA_TOOLS=OFF \\
|
||||
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING=$MACOSX_DEPLOYMENT_TARGET \\
|
||||
-D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" \\
|
||||
-D CMAKE_INSTALL_PREFIX:STRING=$USED_PREFIX
|
||||
cmake --build build $MAKE_THREADS_CNT
|
||||
cmake --install build
|
||||
""")
|
||||
|
||||
stage('protobuf', """
|
||||
win:
|
||||
git clone --recursive -b v21.9 https://github.com/protocolbuffers/protobuf
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
AppVersion 5003000
|
||||
AppVersion 5003001
|
||||
AppVersionStrMajor 5.3
|
||||
AppVersionStrSmall 5.3
|
||||
AppVersionStr 5.3.0
|
||||
AppVersionStrSmall 5.3.1
|
||||
AppVersionStr 5.3.1
|
||||
BetaChannel 0
|
||||
AlphaVersion 0
|
||||
AppVersionOriginal 5.3
|
||||
AppVersionOriginal 5.3.1
|
||||
|
||||
@@ -38,6 +38,7 @@ PUBLIC
|
||||
tdesktop::td_scheme
|
||||
PRIVATE
|
||||
desktop-app::lib_webview
|
||||
desktop-app::external_ada
|
||||
tdesktop::td_lang
|
||||
tdesktop::td_ui
|
||||
)
|
||||
|
||||
Submodule Telegram/lib_webrtc updated: d9a08df0c0...0222032008
Submodule Telegram/lib_webview updated: 4b23992321...c27c69953d
@@ -1,3 +1,9 @@
|
||||
5.3.1 (01.08.24)
|
||||
|
||||
- Open normal links from tonsite-s in system browser.
|
||||
- Fix unicode tonsite:// links.
|
||||
- Fix crash on Linux X11.
|
||||
|
||||
5.3 (31.07.24)
|
||||
|
||||
- View recent and popular web apps in chats search.
|
||||
|
||||
2
cmake
2
cmake
Submodule cmake updated: 17c758e2b9...6a1ac8a4ee
@@ -488,3 +488,21 @@ parts:
|
||||
after:
|
||||
- ffmpeg
|
||||
- libjxl
|
||||
|
||||
ada:
|
||||
source: https://github.com/ada-url/ada.git
|
||||
source-depth: 1
|
||||
source-tag: v2.9.0
|
||||
plugin: cmake
|
||||
build-environment:
|
||||
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
|
||||
cmake-generator: Ninja
|
||||
cmake-parameters:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_INSTALL_PREFIX=/usr
|
||||
- -DADA_TESTING=OFF
|
||||
- -DADA_TOOLS=OFF
|
||||
prime:
|
||||
- -./usr/include
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/cmake
|
||||
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a
|
||||
|
||||
Reference in New Issue
Block a user