Compare commits

..

25 Commits

Author SHA1 Message Date
John Preston
78093173a9 Version 5.2.3.
- Fix crash in bot star stats page.
- Bug fixes and other minor improvements.
2024-07-07 09:01:58 +04:00
John Preston
a01d48f063 Update submodules. 2024-07-06 22:21:04 +04:00
John Preston
149c69c9f5 Use a separate string for Your Stars in Settings. 2024-07-06 22:13:44 +04:00
John Preston
df277b366b Fix build on Windows. 2024-07-06 13:31:44 +04:00
John Preston
f20475f07e Show forbidden icon on disabled webview button. 2024-07-06 13:31:27 +04:00
John Preston
b6664625ea Fix assigning text after formatted text.
Fixes #28115.
2024-07-06 13:31:27 +04:00
John Preston
1028219276 Allow chats list preview for narrow photos. 2024-07-06 11:08:42 +04:00
John Preston
219671a3bc Fix archive in Main Menu context menu. 2024-07-06 11:08:42 +04:00
John Preston
8c97e915ec Create .mm source blanks for macOS modules. 2024-07-06 11:08:42 +04:00
John Preston
b648548001 Don't insert "data:image.." after image paste cancel. 2024-07-06 11:08:42 +04:00
23rd
b377c02ad3 Added support of min boost level for channel ads to feature list. 2024-07-06 11:08:41 +04:00
23rd
66d6b461f3 Fixed support type of credits history entry for ads in earn section. 2024-07-06 11:08:41 +04:00
John Preston
054a6db3ae Fix warnings on Windows in submodules. 2024-07-06 11:08:36 +04:00
Ilya Fedin
bf7042df44 Enable warnings as errors on Windows 2024-07-06 11:05:28 +04:00
Ilya Fedin
aa140b2919 Fix warnings on Windows 2024-07-06 11:05:28 +04:00
Ilya Fedin
8d0d9bb0bd Delay clearing transient parent until the pip window is really exposed 2024-07-06 09:17:04 +04:00
Daniel Novomeský
9ca9904732 Upgrade libjxl to v0.10.3 2024-07-05 21:30:00 +04:00
Daniel Novomeský
e6e1b9446d Upgrade libjxl on Linux to 0.10.3 2024-07-03 20:04:32 +04:00
John Preston
a507d28b49 Version 5.2.2.
- Fix topics search in topic groups.
- Fix Instant View pages content updating.
2024-07-02 19:03:07 +04:00
John Preston
ec2faca145 Fix couple of crashes in secondary windows. 2024-07-02 18:08:24 +04:00
John Preston
17bb430006 Register tg:// scheme on first launch.
Also, allow disabling tg:// re-registration on update.
2024-07-02 13:34:52 +04:00
John Preston
8cbeadc68a Register tg:// scheme on initial launch. 2024-07-02 13:22:33 +04:00
John Preston
3947056654 Use cached views count from not modified page. 2024-07-02 10:40:39 +04:00
John Preston
ad7d1fddf0 Reload IV on each open, take hash into account.
Fixes #28111.
2024-07-02 10:27:26 +04:00
John Preston
ab20f8eb31 Fix topics search in topic groups.
Fixes #28110.
2024-07-02 09:53:56 +04:00
58 changed files with 242 additions and 118 deletions

View File

@@ -169,6 +169,8 @@ jobs:
%TDESKTOP_BUILD_GENERATOR% ^
%TDESKTOP_BUILD_ARCH% ^
%TDESKTOP_BUILD_API% ^
-D CMAKE_C_FLAGS="/WX" ^
-D CMAKE_CXX_FLAGS="/WX" ^
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF ^
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^
-D DESKTOP_APP_NO_PDB=ON ^

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1115,6 +1115,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_faq" = "Telegram FAQ";
"lng_settings_faq_link" = "https://telegram.org/faq#general-questions";
"lng_settings_features" = "Telegram Features";
"lng_settings_credits" = "Your Stars";
"lng_settings_logout" = "Log Out";
"lng_sure_logout" = "Are you sure you want to log out?";

View File

@@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.2.1.0" />
Version="5.2.3.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,2,1,0
PRODUCTVERSION 5,2,1,0
FILEVERSION 5,2,3,0
PRODUCTVERSION 5,2,3,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.2.1.0"
VALUE "FileVersion", "5.2.3.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.2.1.0"
VALUE "ProductVersion", "5.2.3.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,2,1,0
PRODUCTVERSION 5,2,1,0
FILEVERSION 5,2,3,0
PRODUCTVERSION 5,2,3,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.2.1.0"
VALUE "FileVersion", "5.2.3.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.2.1.0"
VALUE "ProductVersion", "5.2.3.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -571,8 +571,8 @@ void _generateDump(EXCEPTION_POINTERS* pExceptionPointers) {
}
if (!hDumpFile || hDumpFile == INVALID_HANDLE_VALUE) {
WCHAR wstrPath[maxFileLen];
DWORD wstrPathLen;
if (wstrPathLen = GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) {
DWORD wstrPathLen = GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen);
if (wstrPathLen) {
wsprintf(wstrPath + wstrPathLen, L"\\%s\\", _programName);
hDumpFile = _generateDumpFileAtPath(wstrPath);
}

View File

@@ -2200,8 +2200,11 @@ void Controller::saveForum() {
channel->inputChannel,
MTP_bool(*_savingData.forum)
)).done([=](const MTPUpdates &result) {
const auto weak = base::make_weak(this);
channel->session().api().applyUpdates(result);
continueSave();
if (weak) { // todo better to be able to save in closed already box.
continueSave();
}
}).fail([=](const MTP::Error &error) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
continueSave();

View File

@@ -459,6 +459,7 @@ Ui::BoostFeatures LookupBoostFeatures(not_null<ChannelData*> channel) {
.customWallpaperLevel = group
? levelLimits.groupCustomWallpaperLevelMin()
: levelLimits.channelCustomWallpaperLevelMin(),
.sponsoredLevel = levelLimits.channelRestrictSponsoredLevelMin(),
};
}

View File

@@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/battery_saving.h"
#include "base/event_filter.h"
#include "base/concurrent_timer.h"
#include "base/options.h"
#include "base/qt_signal_producer.h"
#include "base/timer.h"
#include "base/unixtime.h"
@@ -140,10 +141,18 @@ void SetCrashAnnotationsGL() {
#endif // DESKTOP_APP_USE_ANGLE
}
base::options::toggle OptionSkipUrlSchemeRegister({
.id = kOptionSkipUrlSchemeRegister,
.name = "Skip URL scheme register",
.description = "Don't re-register tg:// URL scheme on autoupdate.",
});
} // namespace
Application *Application::Instance = nullptr;
const char kOptionSkipUrlSchemeRegister[] = "skip-url-scheme-register";
struct Application::Private {
base::Timer quitTimer;
UiIntegration uiIntegration;
@@ -261,9 +270,14 @@ void Application::run() {
refreshGlobalProxy(); // Depends on app settings being read.
if (const auto old = Local::oldSettingsVersion(); old < AppVersion) {
InvokeQueued(this, [] { RegisterUrlScheme(); });
Platform::NewVersionLaunched(old);
if (const auto old = Local::oldSettingsVersion()) {
if (old < AppVersion) {
autoRegisterUrlScheme();
Platform::NewVersionLaunched(old);
}
} else {
// Initial launch.
autoRegisterUrlScheme();
}
if (cAutoStart() && !Platform::AutostartSupported()) {
@@ -405,6 +419,12 @@ void Application::run() {
processCreatedWindow(_lastActivePrimaryWindow);
}
void Application::autoRegisterUrlScheme() {
if (!OptionSkipUrlSchemeRegister.value()) {
InvokeQueued(this, [] { RegisterUrlScheme(); });
}
}
void Application::showAccount(not_null<Main::Account*> account) {
if (const auto separate = separateWindowFor(account)) {
_lastActivePrimaryWindow = separate;

View File

@@ -126,6 +126,8 @@ enum class QuitReason {
QtQuitEvent,
};
extern const char kOptionSkipUrlSchemeRegister[];
class Application final : public QObject {
public:
struct ProxyChange {
@@ -349,6 +351,7 @@ private:
friend bool IsAppLaunched();
friend Application &App();
void autoRegisterUrlScheme();
void clearEmojiSourceImages();
[[nodiscard]] auto prepareEmojiSourceImages()
-> std::shared_ptr<Ui::Emoji::UniversalImages>;

View File

@@ -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 = 5002001;
constexpr auto AppVersionStr = "5.2.1";
constexpr auto AppVersion = 5002003;
constexpr auto AppVersionStr = "5.2.3";
constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;

View File

@@ -121,8 +121,8 @@ struct AlbumCounts {
ImageRoundRadius radius,
bool spoiler) {
const auto original = image->original();
if (original.width() * 10 < original.height()
|| original.height() * 10 < original.width()) {
if (original.width() * 20 < original.height()
|| original.height() * 20 < original.width()) {
return QImage();
}
const auto factor = style::DevicePixelRatio();

View File

@@ -100,7 +100,9 @@ ChatSearchTab SearchState::defaultTabForMe() const {
}
bool SearchState::filterChatsList() const {
return !inChat && (tab == ChatSearchTab::MyMessages);
using Tab = ChatSearchTab;
return !inChat // ThisPeer can be in opened forum.
&& (tab == Tab::MyMessages || tab == Tab::ThisPeer);
}
} // namespace Dialogs

View File

@@ -5668,7 +5668,7 @@ bool HistoryWidget::confirmSendingFiles(
cursor.setPosition(position, QTextCursor::KeepAnchor);
}
_field->setTextCursor(cursor);
if (!insertTextOnCancel.isEmpty()) {
if (Ui::InsertTextOnImageCancel(insertTextOnCancel)) {
_field->textCursor().insertText(insertTextOnCancel);
}
}));

View File

@@ -3415,7 +3415,7 @@ Fn<void()> ComposeControls::restoreTextCallback(
cursor.setPosition(position, QTextCursor::KeepAnchor);
}
_field->setTextCursor(cursor);
if (!insertTextOnCancel.isEmpty()) {
if (Ui::InsertTextOnImageCancel(insertTextOnCancel)) {
_field->textCursor().insertText(insertTextOnCancel);
}
});

View File

@@ -76,9 +76,9 @@ namespace {
return rpl::single(ContentWithoutPreview(item, repaint));
}
constexpr auto kFullLoaded = 2;
constexpr auto kSomeLoaded = 1;
constexpr auto kNotLoaded = 0;
const auto loadedLevel = [=] {
constexpr auto kSomeLoaded = 1;
constexpr auto kNotLoaded = 0;
const auto preview = media->replyPreview();
return media->replyPreviewLoaded()
? kFullLoaded

View File

@@ -167,7 +167,7 @@ void SimilarChannels::draw(Painter &p, const PaintContext &context) const {
_hasHeavyPart = 1;
validateLastPremiumLock();
const auto drawOne = [&](const Channel &channel) {
const auto geometry = channel.geometry.translated(-_scrollLeft, 0);
const auto geometry = channel.geometry.translated(-int(_scrollLeft), 0);
const auto right = geometry.x() + geometry.width();
if (right <= 0) {
return;
@@ -501,7 +501,7 @@ TextState SimilarChannels::textState(
return result;
}
for (const auto &channel : _channels) {
if (channel.geometry.translated(-_scrollLeft, 0).contains(point)) {
if (channel.geometry.translated(-int(_scrollLeft), 0).contains(point)) {
result.link = channel.link;
_lastPoint = point
+ QPoint(_scrollLeft, 0)

View File

@@ -71,6 +71,12 @@ bool Data::partial() const {
Data::~Data() = default;
void Data::updateCachedViews(int cachedViews) {
_source->updatedCachedViews = std::max(
_source->updatedCachedViews,
cachedViews);
}
void Data::prepare(const Options &options, Fn<void(Prepared)> done) const {
crl::async([source = *_source, options, done = std::move(done)] {
done(Prepare(source, options));

View File

@@ -45,6 +45,8 @@ public:
[[nodiscard]] QString id() const;
[[nodiscard]] bool partial() const;
void updateCachedViews(int cachedViews);
void prepare(const Options &options, Fn<void(Prepared)> done) const;
private:

View File

@@ -57,6 +57,7 @@ constexpr auto kGeoPointScale = 1;
constexpr auto kGeoPointZoomMin = 13;
constexpr auto kMaxLoadParts = 5;
constexpr auto kKeepLoadingParts = 8;
constexpr auto kAllowPageReloadAfter = 3 * crl::time(1000);
} // namespace
@@ -815,19 +816,19 @@ void Instance::show(
}
break;
case Type::OpenPage:
case Type::OpenLink:
case Type::OpenLink: {
if (!urlChecked) {
break;
}
_fullRequested[_shownSession].emplace(event.url);
_shownSession->api().request(MTPmessages_GetWebPage(
MTP_string(event.url),
MTP_int(0)
const auto session = _shownSession;
const auto url = event.url;
auto &requested = _fullRequested[session][url];
requested.lastRequestedAt = crl::now();
session->api().request(MTPmessages_GetWebPage(
MTP_string(url),
MTP_int(requested.hash)
)).done([=](const MTPmessages_WebPage &result) {
_shownSession->data().processUsers(result.data().vusers());
_shownSession->data().processChats(result.data().vchats());
const auto page = _shownSession->data().processWebpage(
result.data().vwebpage());
const auto page = processReceivedPage(session, url, result);
if (page && page->iv) {
const auto parts = event.url.split('#');
const auto hash = (parts.size() > 1) ? parts[1] : u""_q;
@@ -838,7 +839,7 @@ void Instance::show(
}).fail([=] {
UrlClickHandler::Open(event.url);
}).send();
break;
} break;
case Type::Report:
if (const auto controller = _shownSession->tryResolveWindow()) {
controller->window().activate();
@@ -954,15 +955,13 @@ void Instance::openWithIvPreferred(
};
_ivRequestSession = session;
_ivRequestUri = uri;
_fullRequested[session].emplace(url);
auto &requested = _fullRequested[session][url];
requested.lastRequestedAt = crl::now();
_ivRequestId = session->api().request(MTPmessages_GetWebPage(
MTP_string(url),
MTP_int(0)
MTP_int(requested.hash)
)).done([=](const MTPmessages_WebPage &result) {
const auto &data = result.data();
session->data().processUsers(data.vusers());
session->data().processChats(data.vchats());
finish(session->data().processWebpage(data.vwebpage()));
finish(processReceivedPage(session, url, result));
}).fail([=] {
finish(nullptr);
}).send();
@@ -971,24 +970,53 @@ void Instance::openWithIvPreferred(
void Instance::requestFull(
not_null<Main::Session*> session,
const QString &id) {
if (!_tracking.contains(session)
|| !_fullRequested[session].emplace(id).second) {
if (!_tracking.contains(session)) {
return;
}
auto &requested = _fullRequested[session][id];
const auto last = requested.lastRequestedAt;
const auto now = crl::now();
if (last && (now - last) < kAllowPageReloadAfter) {
return;
}
requested.lastRequestedAt = now;
session->api().request(MTPmessages_GetWebPage(
MTP_string(id),
MTP_int(0)
MTP_int(requested.hash)
)).done([=](const MTPmessages_WebPage &result) {
session->data().processUsers(result.data().vusers());
session->data().processChats(result.data().vchats());
const auto page = session->data().processWebpage(
result.data().vwebpage());
const auto page = processReceivedPage(session, id, result);
if (page && page->iv && _shown && _shownSession == session) {
_shown->update(page->iv.get());
}
}).send();
}
WebPageData *Instance::processReceivedPage(
not_null<Main::Session*> session,
const QString &url,
const MTPmessages_WebPage &result) {
const auto &data = result.data();
const auto owner = &session->data();
owner->processUsers(data.vusers());
owner->processChats(data.vchats());
auto &requested = _fullRequested[session][url];
const auto &mtp = data.vwebpage();
mtp.match([&](const MTPDwebPageNotModified &data) {
const auto page = requested.page;
if (const auto views = data.vcached_page_views()) {
if (page && page->iv) {
page->iv->updateCachedViews(views->v);
}
}
}, [&](const MTPDwebPage &data) {
requested.hash = data.vhash().v;
requested.page = owner->processWebpage(data).get();
}, [&](const auto &) {
requested.page = owner->processWebpage(mtp).get();
});
return requested.page;
}
void Instance::processOpenChannel(const QString &context) {
if (!_shownSession) {
return;

View File

@@ -61,12 +61,23 @@ public:
[[nodiscard]] rpl::lifetime &lifetime();
private:
struct FullResult {
crl::time lastRequestedAt = 0;
WebPageData *page = nullptr;
int32 hash = 0;
};
void processOpenChannel(const QString &context);
void processJoinChannel(const QString &context);
void requestFull(not_null<Main::Session*> session, const QString &id);
void trackSession(not_null<Main::Session*> session);
WebPageData *processReceivedPage(
not_null<Main::Session*> session,
const QString &url,
const MTPmessages_WebPage &result);
const not_null<Delegate*> _delegate;
std::unique_ptr<Shown> _shown;
@@ -77,7 +88,7 @@ private:
base::flat_set<not_null<ChannelData*>>> _joining;
base::flat_map<
not_null<Main::Session*>,
base::flat_set<QString>> _fullRequested;
base::flat_map<QString, FullResult>> _fullRequested;
base::flat_map<
not_null<Main::Session*>,

View File

@@ -229,7 +229,9 @@ Parser::Parser(const Source &source, const Options &options)
_result.name = source.name;
_result.rtl = source.page.data().is_rtl();
const auto views = source.page.data().vviews().value_or_empty();
const auto views = std::max(
source.page.data().vviews().value_or_empty(),
source.updatedCachedViews);
const auto content = list(source.page.data().vblocks());
_result.content = wrap(content, views);
}

View File

@@ -18,6 +18,7 @@ struct Source {
std::optional<MTPPhoto> webpagePhoto;
std::optional<MTPDocument> webpageDocument;
QString name;
int updatedCachedViews = 0;
};
[[nodiscard]] Prepared Prepare(const Source &source, const Options &options);

View File

@@ -1192,9 +1192,11 @@ void MainWidget::setInnerFocus() {
_mainSection->setInnerFocus();
} else if (!_hider && _thirdSection) {
_thirdSection->setInnerFocus();
} else {
Assert(_dialogs != nullptr);
} else if (_dialogs) {
_dialogs->setInnerFocus();
} else {
// Maybe we're just closing a child window, content is destroyed.
_history->setFocus();
}
} else if (_mainSection) {
_mainSection->setInnerFocus();
@@ -1293,8 +1295,9 @@ void MainWidget::showHistory(
}
const auto unavailable = peer->computeUnavailableReason();
if (!unavailable.isEmpty()) {
Assert(isPrimary()); // windows todo
if (params.activation != anim::activation::background) {
if (!isPrimary()) {
_controller->window().close();
} else if (params.activation != anim::activation::background) {
_controller->show(Ui::MakeInformBox(unavailable));
_controller->window().activate();
}
@@ -1950,10 +1953,9 @@ void MainWidget::showNonPremiumLimitToast(bool download) {
});
}
void MainWidget::showBackFromStack(
const SectionShow &params) {
bool MainWidget::showBackFromStack(const SectionShow &params) {
if (preventsCloseSection([=] { showBackFromStack(params); }, params)) {
return;
return false;
}
if (_stack.empty()) {
@@ -1963,7 +1965,7 @@ void MainWidget::showBackFromStack(
crl::on_main(this, [=] {
_controller->widget()->setInnerFocus();
});
return;
return (_dialogs != nullptr);
}
auto item = std::move(_stack.back());
_stack.pop_back();
@@ -1995,6 +1997,7 @@ void MainWidget::showBackFromStack(
anim::activation::background));
}
return true;
}
void MainWidget::orderWidgets() {

View File

@@ -152,8 +152,7 @@ public:
const SectionShow &params);
void updateColumnLayout();
bool stackIsEmpty() const;
void showBackFromStack(
const SectionShow &params);
bool showBackFromStack(const SectionShow &params);
void orderWidgets();
QPixmap grabForShowAnimation(const Window::SectionSlideParams &params);
void checkMainSectionToLayer();

View File

@@ -351,10 +351,14 @@ void PipPanel::init() {
widget()->resize(0, 0);
widget()->hide();
rp()->shownValue(
) | rpl::filter([=](bool shown) {
return shown;
}) | rpl::start_with_next([=] {
rpl::merge(
rp()->shownValue() | rpl::to_empty,
rp()->paintRequest() | rpl::to_empty
) | rpl::map([=] {
return widget()->windowHandle()
&& widget()->windowHandle()->isExposed();
}) | rpl::distinct_until_changed(
) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] {
// Workaround Qt's forced transient parent.
Ui::Platform::ClearTransientParent(widget());
}, rp()->lifetime());

View File

@@ -98,7 +98,6 @@ BOOL CALLBACK FindToActivate(HWND hwnd, LPARAM lParam) {
return TRUE;
}
// Found a Top-Level window.
auto level = 0;
if (WindowIdFromHWND(hwnd) == request->windowId) {
request->result = hwnd;
request->resultLevel = 3;
@@ -310,8 +309,8 @@ void psDoFixPrevious() {
if (oldKeyRes2 == ERROR_SUCCESS) RegCloseKey(oldKey2);
if (existNew1 || existNew2) {
const auto deleteKeyRes1 = existOld1 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr1.c_str()) : ERROR_SUCCESS;
const auto deleteKeyRes2 = existOld2 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr2.c_str()) : ERROR_SUCCESS;
if (existOld1) RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr1.c_str());
if (existOld2) RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr2.c_str());
}
QString userDesktopLnk, commonDesktopLnk;
@@ -326,7 +325,7 @@ void psDoFixPrevious() {
}
QFile userDesktopFile(userDesktopLnk), commonDesktopFile(commonDesktopLnk);
if (QFile::exists(userDesktopLnk) && QFile::exists(commonDesktopLnk) && userDesktopLnk != commonDesktopLnk) {
bool removed = QFile::remove(commonDesktopLnk);
QFile::remove(commonDesktopLnk);
}
} catch (...) {
}

View File

@@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/unique_qptr.h"
namespace Window {
class CounterLayerArgs;
struct CounterLayerArgs;
} // namespace Window
namespace Ui {

View File

@@ -152,6 +152,7 @@ void SetupExperimental(
addToggle(kOptionAutoScrollInactiveChat);
addToggle(Window::Notifications::kOptionGNotification);
addToggle(Core::kOptionFreeType);
addToggle(Core::kOptionSkipUrlSchemeRegister);
addToggle(Data::kOptionExternalVideoPlayer);
addToggle(Window::kOptionNewWindowsSizeAsFirst);
}

View File

@@ -503,7 +503,7 @@ void SetupPremium(
AddPremiumStar(
AddButtonWithLabel(
wrap->entity(),
tr::lng_credits_summary_title(),
tr::lng_settings_credits(),
controller->session().creditsValue(
) | rpl::map([=](uint64 c) {
return c ? Lang::FormatCountToShort(c).string : QString{};

View File

@@ -553,7 +553,7 @@ bool ReadSetting(
const auto proxy = readProxy();
if (proxy) {
list.push_back(proxy);
} else if (index < -list.size()) {
} else if (index < -int64(list.size())) {
++index;
} else if (index > list.size()) {
--index;

View File

@@ -175,7 +175,7 @@ void AddFeaturesList(
st::boostFeatureIconPosition);
};
const auto proj = &Ui::Text::RichLangValue;
const auto max = std::max({
const auto lowMax = std::max({
features.linkLogoLevel,
features.transcribeLevel,
features.emojiPackLevel,
@@ -189,9 +189,13 @@ void AddFeaturesList(
? 0
: features.linkStylesByLevel.back().first),
});
const auto highMax = std::max(lowMax, features.sponsoredLevel);
auto nameColors = 0;
auto linkStyles = 0;
for (auto i = std::max(startFromLevel, 1); i <= max; ++i) {
for (auto i = std::max(startFromLevel, 1); i <= highMax; ++i) {
if ((i > lowMax) && (i < highMax)) {
continue;
}
const auto unlocks = (i == startFromLevel);
container->add(
MakeFeaturesBadge(
@@ -202,6 +206,9 @@ void AddFeaturesList(
lt_count,
rpl::single(float64(i)))),
st::boostLevelBadgePadding);
if (i >= features.sponsoredLevel) {
add(tr::lng_channel_earn_off(proj), st::boostFeatureOffSponsored);
}
if (i >= features.customWallpaperLevel) {
add(
(group

View File

@@ -40,6 +40,7 @@ struct BoostFeatures {
int wallpaperLevel = 0;
int wallpapersCount = 0;
int customWallpaperLevel = 0;
int sponsoredLevel = 0;
};
struct BoostBoxData {

View File

@@ -178,6 +178,8 @@ void Panel::Button::updateFg(QColor fg) {
void Panel::Button::updateArgs(MainButtonArgs &&args) {
_textFull = std::move(args.text);
setDisabled(!args.isActive);
setPointerCursor(false);
setCursor(args.isActive ? style::cur_pointer : Qt::ForbiddenCursor);
setVisible(args.isVisible);
toggleProgress(args.isProgressVisible);
update();

View File

@@ -82,6 +82,10 @@ bool CanBeInAlbumType(PreparedFile::Type type, AlbumType album) {
Unexpected("AlbumType in CanBeInAlbumType.");
}
bool InsertTextOnImageCancel(const QString &text) {
return !text.isEmpty() && !text.startsWith(u"data:image"_q);
}
PreparedList PreparedList::Reordered(
PreparedList &&list,
std::vector<int> order) {

View File

@@ -88,6 +88,7 @@ struct PreparedFile {
};
[[nodiscard]] bool CanBeInAlbumType(PreparedFile::Type type, AlbumType album);
[[nodiscard]] bool InsertTextOnImageCancel(const QString &text);
struct PreparedList {
enum class Error {

View File

@@ -47,3 +47,5 @@ creditsBoxButtonLabel: FlatLabel(defaultFlatLabel) {
starIconSmall: icon{{ "payments/small_star", windowFg }};
starIconSmallPadding: margins(0px, -2px, 0px, 0px);
creditsHistoryEntryTypeAds: icon {{ "folders/folders_channels", premiumButtonFg }};

View File

@@ -205,6 +205,8 @@ PaintRoundImageCallback GenerateCreditsPaintUserpicCallback(
return { st::historyPeer8UserpicBg, st::historyPeer8UserpicBg2 };
case Data::CreditsHistoryEntry::PeerType::PremiumBot:
return { st::historyPeer8UserpicBg, st::historyPeer8UserpicBg2 };
case Data::CreditsHistoryEntry::PeerType::Ads:
return { st::historyPeer6UserpicBg, st::historyPeer6UserpicBg2 };
case Data::CreditsHistoryEntry::PeerType::Unsupported:
return {
st::historyPeerArchiveUserpicBg,
@@ -227,6 +229,8 @@ PaintRoundImageCallback GenerateCreditsPaintUserpicCallback(
? st::sessionIconAndroid
: (entry.peerType == PeerType::Fragment)
? st::introFragmentIcon
: (entry.peerType == PeerType::Ads)
? st::creditsHistoryEntryTypeAds
: st::dialogsInaccessibleUserpic).paintInCenter(p, rect);
};
}
@@ -442,6 +446,8 @@ Fn<PaintRoundImageCallback(Fn<void()>)> PaintPreviewCallback(
TextWithEntities GenerateEntryName(const Data::CreditsHistoryEntry &entry) {
return ((entry.peerType == Data::CreditsHistoryEntry::PeerType::Fragment)
? tr::lng_bot_username_description1_link
: (entry.peerType == Data::CreditsHistoryEntry::PeerType::Ads)
? tr::lng_credits_box_history_entry_ads
: tr::lng_credits_summary_history_entry_inner_in)(
tr::now,
TextWithEntities::Simple);

View File

@@ -364,3 +364,4 @@ boostFeatureLink: icon{{ "settings/premium/features/feature_links", windowBgActi
boostFeatureName: icon{{ "settings/premium/features/feature_color_names", windowBgActive }};
boostFeatureStories: icon{{ "settings/premium/features/feature_stories", windowBgActive }};
boostFeatureTranscribe: icon{{ "settings/premium/features/feature_voice", windowBgActive }};
boostFeatureOffSponsored: icon{{ "settings/premium/features/feature_off_sponsored", windowBgActive }};

View File

@@ -1472,7 +1472,8 @@ void Filler::fillArchiveActions() {
const auto controller = _controller;
const auto hidden = controller->session().settings().archiveCollapsed();
{
const auto inmenu = controller->session().settings().archiveInMainMenu();
if (!inmenu) {
const auto text = hidden
? tr::lng_context_archive_expand(tr::now)
: tr::lng_context_archive_collapse(tr::now);
@@ -1481,7 +1482,6 @@ void Filler::fillArchiveActions() {
controller->session().saveSettingsDelayed();
}, hidden ? &st::menuIconExpand : &st::menuIconCollapse);
}
const auto inmenu = controller->session().settings().archiveInMainMenu();
{
const auto text = inmenu
? tr::lng_context_archive_to_list(tr::now)

View File

@@ -1660,8 +1660,9 @@ void SessionController::showForum(
) | rpl::start_with_next([=, history = forum->history()] {
const auto now = activeChatCurrent().owningHistory();
const auto showHistory = !now || (now == history);
const auto weak = base::make_weak(this);
closeForum();
if (showHistory) {
if (weak && showHistory) {
showPeerHistory(history, {
SectionShow::Way::Backward,
anim::type::normal,
@@ -1676,7 +1677,7 @@ void SessionController::closeForum() {
if (const auto forum = _shownForum.current()) {
const auto id = windowId();
if (id.type == SeparateType::Forum) {
const auto initial = id.thread->asForum();
const auto initial = id.forum();
if (!initial || initial == forum) {
Core::App().closeWindow(_window);
} else {
@@ -2529,7 +2530,13 @@ void SessionController::showBackFromStack(const SectionShow &params) {
return topic && topic->forum()->topicDeleted(topic->rootId());
};
do {
content()->showBackFromStack(params);
const auto empty = content()->stackIsEmpty();
const auto shown = content()->showBackFromStack(params);
if (empty && !shown && content()->stackIsEmpty() && bad()) {
clearSectionStack(anim::type::instant);
window().close();
break;
}
} while (bad());
}

View File

@@ -250,7 +250,7 @@ COPY --link --from=lcms2 {{ LibrariesPath }}/lcms2-cache /
COPY --link --from=brotli {{ LibrariesPath }}/brotli-cache /
COPY --link --from=highway {{ LibrariesPath }}/highway-cache /
RUN git clone -b v0.10.2 --depth=1 {{ GIT }}/libjxl/libjxl.git \
RUN git clone -b v0.10.3 --depth=1 {{ GIT }}/libjxl/libjxl.git \
&& cd libjxl \
&& git apply ../patches/libjxl.patch \
&& git submodule update --init --recursive --depth=1 third_party/libjpeg-turbo \

View File

@@ -938,7 +938,7 @@ mac:
""")
stage('libjxl', """
git clone -b v0.8.2 --recursive --shallow-submodules https://github.com/libjxl/libjxl.git
git clone -b v0.10.3 --recursive --shallow-submodules https://github.com/libjxl/libjxl.git
cd libjxl
""" + setVar("cmake_defines", """
-DBUILD_SHARED_LIBS=OFF
@@ -954,12 +954,10 @@ stage('libjxl', """
-DJPEGXL_ENABLE_SJPEG=OFF
-DJPEGXL_ENABLE_OPENEXR=OFF
-DJPEGXL_ENABLE_SKCMS=ON
-DJPEGXL_BUNDLE_SKCMS=ON
-DJPEGXL_ENABLE_VIEWERS=OFF
-DJPEGXL_ENABLE_TCMALLOC=OFF
-DJPEGXL_ENABLE_PLUGINS=OFF
-DJPEGXL_ENABLE_COVERAGE=OFF
-DJPEGXL_ENABLE_PROFILER=OFF
-DJPEGXL_WARNINGS_AS_ERRORS=OFF
""") + """
win:
@@ -967,8 +965,8 @@ win:
-A %WIN32X64% ^
-DCMAKE_INSTALL_PREFIX=%LIBS_DIR%/local ^
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" ^
-DCMAKE_C_FLAGS="/DJXL_STATIC_DEFINE /DJXL_THREADS_STATIC_DEFINE" ^
-DCMAKE_CXX_FLAGS="/DJXL_STATIC_DEFINE /DJXL_THREADS_STATIC_DEFINE" ^
-DCMAKE_C_FLAGS="/DJXL_STATIC_DEFINE /DJXL_THREADS_STATIC_DEFINE /DJXL_CMS_STATIC_DEFINE" ^
-DCMAKE_CXX_FLAGS="/DJXL_STATIC_DEFINE /DJXL_THREADS_STATIC_DEFINE /DJXL_CMS_STATIC_DEFINE" ^
-DCMAKE_C_FLAGS_DEBUG="/MTd /Zi /Ob0 /Od /RTC1" ^
-DCMAKE_CXX_FLAGS_DEBUG="/MTd /Zi /Ob0 /Od /RTC1" ^
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" ^

View File

@@ -1,7 +1,7 @@
AppVersion 5002001
AppVersion 5002003
AppVersionStrMajor 5.2
AppVersionStrSmall 5.2.1
AppVersionStr 5.2.1
AppVersionStrSmall 5.2.3
AppVersionStr 5.2.3
BetaChannel 0
AlphaVersion 0
AppVersionOriginal 5.2.1
AppVersionOriginal 5.2.3

View File

@@ -134,20 +134,13 @@ PRIVATE
)
if (WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(lib_tgvoip_bundled
PRIVATE
/wd4005
/wd4244 # conversion from 'int' to 'float', possible loss of data (several in webrtc)
/wd5055 # operator '>' deprecated between enumerations and floating-point types
)
else()
target_compile_definitions(lib_tgvoip_bundled
PUBLIC
# Doesn't build with mingw for now
TGVOIP_NO_DSP
)
endif()
target_compile_options_if_exists(lib_tgvoip_bundled
PRIVATE
/wd4005 # 'identifier' : macro redefinition
/wd4068 # unknown pragma
/wd4996 # deprecated
/wd5055 # operator '>' deprecated between enumerations and floating-point types
)
elseif (APPLE)
target_compile_definitions(lib_tgvoip_bundled
PUBLIC

View File

@@ -67,26 +67,30 @@ exit /b %errorlevel%
set "CommandPath=%1"
set "CommandPathUnix=!CommandPath:\=/!"
set "CommandPathWin=!CommandPath:/=\!"
if "!CommandPathUnix:~-4!" == "_mac" (
set "CommandExt=mm"
) else (
set "CommandExt=cpp"
)
if "!CommandPathUnix!" == "" (
echo Provide source path.
exit /b 1
) else if exist "SourceFiles\!CommandPathWin!.cpp" (
) else if exist "SourceFiles\!CommandPathWin!.!CommandExt!" (
echo This source already exists.
exit /b 1
)
echo Generating source !CommandPathUnix!.cpp..
mkdir "SourceFiles\!CommandPathWin!.cpp"
rmdir "SourceFiles\!CommandPathWin!.cpp"
echo Generating source !CommandPathUnix!.!CommandExt!..
mkdir "SourceFiles\!CommandPathWin!.!CommandExt!"
rmdir "SourceFiles\!CommandPathWin!.!CommandExt!"
call :write_comment !CommandPathWin!.cpp
call :write_comment !CommandPathWin!.!CommandExt!
set "quote="""
set "quote=!quote:~0,1!"
set "source1=#include !quote!!CommandPathUnix!.h!quote!"
(
echo !source1!
echo.
)>> "SourceFiles\!CommandPathWin!.cpp"
)>> "SourceFiles\!CommandPathWin!.!CommandExt!"
exit /b
)

View File

@@ -1,3 +1,13 @@
5.2.3 (07.07.24)
- Fix crash in bot star stats page.
- Bug fixes and other minor improvements.
5.2.2 (02.07.24)
- Fix topics search in topic groups.
- Fix Instant View pages content updating.
5.2.1 (01.07.24)
- Fix crash when opening topic in a new window.

2
cmake

Submodule cmake updated: 5742caae65...4a4bc4cd34

View File

@@ -237,7 +237,7 @@ parts:
libjxl:
source: https://github.com/libjxl/libjxl.git
source-depth: 1
source-tag: v0.10.2
source-tag: v0.10.3
plugin: cmake
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s