Merge tag 'v5.5.4' into dev

# Conflicts:
#	.github/workflows/mac_packaged.yml
#	.github/workflows/snap.yml
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/core/version.h
This commit is contained in:
AlexeyZavar 2024-09-12 23:13:38 +03:00
commit 7caf421074
17 changed files with 114 additions and 56 deletions

View file

@ -42,7 +42,7 @@ jobs:
windows: windows:
name: Windows name: Windows
runs-on: windows-2022 runs-on: windows-latest
strategy: strategy:
matrix: matrix:
@ -94,6 +94,14 @@ jobs:
nuget sources Disable -Name "Microsoft Visual Studio Offline Packages" nuget sources Disable -Name "Microsoft Visual Studio Offline Packages"
nuget sources Add -Source https://api.nuget.org/v3/index.json & exit 0 nuget sources Add -Source https://api.nuget.org/v3/index.json & exit 0
- name: ThirdParty cache.
id: cache-third-party
uses: actions/cache@v4
with:
path: ${{ env.TBUILD }}\ThirdParty
key: ${{ runner.OS }}-${{ matrix.arch }}-third-party-${{ env.CACHE_KEY }}
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-third-party-
- name: Libraries cache. - name: Libraries cache.
id: cache-libs id: cache-libs
uses: actions/cache@v4 uses: actions/cache@v4

View file

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

View file

@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,5,3,0 FILEVERSION 5,5,4,0
PRODUCTVERSION 5,5,3,0 PRODUCTVERSION 5,5,4,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -62,10 +62,10 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Radolyn Labs" VALUE "CompanyName", "Radolyn Labs"
VALUE "FileDescription", "AyuGram Desktop" VALUE "FileDescription", "AyuGram Desktop"
VALUE "FileVersion", "5.5.3.0" VALUE "FileVersion", "5.5.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024" VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "AyuGram Desktop" VALUE "ProductName", "AyuGram Desktop"
VALUE "ProductVersion", "5.5.3.0" VALUE "ProductVersion", "5.5.4.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,5,3,0 FILEVERSION 5,5,4,0
PRODUCTVERSION 5,5,3,0 PRODUCTVERSION 5,5,4,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -53,10 +53,10 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Radolyn Labs" VALUE "CompanyName", "Radolyn Labs"
VALUE "FileDescription", "AyuGram Desktop Updater" VALUE "FileDescription", "AyuGram Desktop Updater"
VALUE "FileVersion", "5.5.3.0" VALUE "FileVersion", "5.5.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024" VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "AyuGram Desktop" VALUE "ProductName", "AyuGram Desktop"
VALUE "ProductVersion", "5.5.3.0" VALUE "ProductVersion", "5.5.4.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -659,6 +659,7 @@ void Updates::getDifferenceAfterFail() {
wait = wait ? std::min(wait, i->second - now) : (i->second - now); wait = wait ? std::min(wait, i->second - now) : (i->second - now);
++i; ++i;
} else { } else {
i->first->ptsSetRequesting(false);
getChannelDifference(i->first, ChannelDifferenceRequest::AfterFail); getChannelDifference(i->first, ChannelDifferenceRequest::AfterFail);
i = _whenGetDiffAfterFail.erase(i); i = _whenGetDiffAfterFail.erase(i);
} }
@ -707,7 +708,9 @@ void Updates::getChannelDifference(
_whenGetDiffByPts.remove(channel); _whenGetDiffByPts.remove(channel);
} }
if (!channel->ptsInited() || channel->ptsRequesting()) return; if (!channel->ptsInited() || channel->ptsRequesting()) {
return;
}
if (from != ChannelDifferenceRequest::AfterFail) { if (from != ChannelDifferenceRequest::AfterFail) {
_whenGetDiffAfterFail.remove(channel); _whenGetDiffAfterFail.remove(channel);
@ -1562,6 +1565,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
} }
if (channel && !_handlingChannelDifference) { if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping new channel message because getting the difference."));
return; return;
} }
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update); channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@ -1654,6 +1658,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
if (channel && !_handlingChannelDifference) { if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping channel message edit because getting the difference."));
return; return;
} else { } else {
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update); channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@ -1669,6 +1674,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
if (channel && !_handlingChannelDifference) { if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping pinned channel messages because getting the difference."));
return; return;
} else { } else {
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update); channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@ -1783,6 +1789,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
if (channel && !_handlingChannelDifference) { if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping delete channel messages because getting the difference."));
return; return;
} }
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update); channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);
@ -1846,6 +1853,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
auto channel = session().data().channelLoaded(d.vchannel_id()); auto channel = session().data().channelLoaded(d.vchannel_id());
if (channel && !_handlingChannelDifference) { if (channel && !_handlingChannelDifference) {
if (channel->ptsRequesting()) { // skip global updates while getting channel difference if (channel->ptsRequesting()) { // skip global updates while getting channel difference
MTP_LOG(0, ("Skipping channel web page update because getting the difference."));
return; return;
} else { } else {
channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update); channel->ptsUpdateAndApply(d.vpts().v, d.vpts_count().v, update);

View file

@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D666}"_cs;
constexpr auto AppNameOld = "AyuGram for Windows"_cs; constexpr auto AppNameOld = "AyuGram for Windows"_cs;
constexpr auto AppName = "AyuGram Desktop"_cs; constexpr auto AppName = "AyuGram Desktop"_cs;
constexpr auto AppFile = "AyuGram"_cs; constexpr auto AppFile = "AyuGram"_cs;
constexpr auto AppVersion = 5005003; constexpr auto AppVersion = 5005004;
constexpr auto AppVersionStr = "5.5.3"; constexpr auto AppVersionStr = "5.5.4";
constexpr auto AppBetaVersion = false; constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;

View file

@ -1726,6 +1726,10 @@ MediaWebPageFlags MediaWebPage::webpageFlags() const {
return _flags; return _flags;
} }
Storage::SharedMediaTypesMask MediaWebPage::sharedMediaTypes() const {
return Storage::SharedMediaType::Link;
}
bool MediaWebPage::hasReplyPreview() const { bool MediaWebPage::hasReplyPreview() const {
if (const auto document = MediaWebPage::document()) { if (const auto document = MediaWebPage::document()) {
return document->hasThumbnail() return document->hasThumbnail()

View file

@ -446,6 +446,8 @@ public:
WebPageData *webpage() const override; WebPageData *webpage() const override;
MediaWebPageFlags webpageFlags() const override; MediaWebPageFlags webpageFlags() const override;
Storage::SharedMediaTypesMask sharedMediaTypes() const override;
bool hasReplyPreview() const override; bool hasReplyPreview() const override;
Image *replyPreview() const override; Image *replyPreview() const override;
bool replyPreviewLoaded() const override; bool replyPreviewLoaded() const override;

View file

@ -191,7 +191,7 @@ void SetupSwipeHandler(
const auto t = static_cast<QTouchEvent*>(e.get()); const auto t = static_cast<QTouchEvent*>(e.get());
const auto touchscreen = t->device() const auto touchscreen = t->device()
&& (t->device()->type() == base::TouchDevice::TouchScreen); && (t->device()->type() == base::TouchDevice::TouchScreen);
if (!Platform::IsMac() && !touchscreen) { if (/*!Platform::IsMac() && */!touchscreen) {
break; break;
} else if (type == QEvent::TouchBegin) { } else if (type == QEvent::TouchBegin) {
// Reset state in case we lost some TouchEnd. // Reset state in case we lost some TouchEnd.
@ -235,6 +235,7 @@ void SetupSwipeHandler(
case QEvent::Wheel: { case QEvent::Wheel: {
const auto w = static_cast<QWheelEvent*>(e.get()); const auto w = static_cast<QWheelEvent*>(e.get());
const auto phase = w->phase(); const auto phase = w->phase();
#if 0
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
if (phase == Qt::ScrollBegin) { if (phase == Qt::ScrollBegin) {
state->twoFingerScrollStarted = true; state->twoFingerScrollStarted = true;
@ -246,7 +247,8 @@ void SetupSwipeHandler(
state->twoFingerScrollStarted = false; state->twoFingerScrollStarted = false;
} }
#endif // Q_OS_MAC #endif // Q_OS_MAC
if (Platform::IsMac() || phase == Qt::NoScrollPhase) { #endif
if (/*Platform::IsMac() || */phase == Qt::NoScrollPhase) {
break; break;
} else if (phase == Qt::ScrollBegin) { } else if (phase == Qt::ScrollBegin) {
// Reset state in case we lost some TouchEnd. // Reset state in case we lost some TouchEnd.

View file

@ -169,6 +169,13 @@ infoTopBarCall: IconButton(infoTopBarMenu) {
iconPosition: point(5px, -1px); iconPosition: point(5px, -1px);
rippleAreaPosition: point(0px, 6px); rippleAreaPosition: point(0px, 6px);
} }
infoTopBarQr: IconButton(infoTopBarMenu) {
width: 52px;
icon: icon {{ "menu/qr_code", boxTitleCloseFg }};
iconOver: icon {{ "menu/qr_code", boxTitleCloseFgOver }};
iconPosition: point(9px, -1px);
rippleAreaPosition: point(0px, 6px);
}
infoTopBarForward: IconButton(infoTopBarBack) { infoTopBarForward: IconButton(infoTopBarBack) {
width: 46px; width: 46px;
icon: icon {{ "info/info_media_forward", boxTitleCloseFg }}; icon: icon {{ "info/info_media_forward", boxTitleCloseFg }};
@ -262,6 +269,12 @@ infoLayerTopBarCall: IconButton(infoLayerTopBarMenu) {
iconOver: icon {{ "top_bar_call", boxTitleCloseFgOver }}; iconOver: icon {{ "top_bar_call", boxTitleCloseFgOver }};
iconPosition: point(3px, -1px); iconPosition: point(3px, -1px);
} }
infoLayerTopBarQr: IconButton(infoLayerTopBarClose) {
width: 40px;
icon: icon {{ "menu/qr_code", boxTitleCloseFg }};
iconOver: icon {{ "menu/qr_code", boxTitleCloseFgOver }};
iconPosition: point(8px, -1px);
}
infoLayerTopBarForward: IconButton(infoLayerTopBarBack) { infoLayerTopBarForward: IconButton(infoLayerTopBarBack) {
width: 45px; width: 45px;
icon: icon {{ "info/info_media_forward", boxTitleCloseFg }}; icon: icon {{ "info/info_media_forward", boxTitleCloseFg }};

View file

@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/info_top_bar.h" #include "info/info_top_bar.h"
#include "settings/cloud_password/settings_cloud_password_email_confirm.h" #include "settings/cloud_password/settings_cloud_password_email_confirm.h"
#include "settings/settings_chat.h" #include "settings/settings_chat.h"
#include "settings/settings_information.h"
#include "settings/settings_main.h" #include "settings/settings_main.h"
#include "settings/settings_premium.h" #include "settings/settings_premium.h"
#include "ui/effects/ripple_animation.h" // MaskByDrawer. #include "ui/effects/ripple_animation.h" // MaskByDrawer.
@ -35,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_slide_animation.h" #include "window/window_slide_animation.h"
#include "boxes/peer_list_box.h" #include "boxes/peer_list_box.h"
#include "ui/boxes/confirm_box.h" #include "ui/boxes/confirm_box.h"
#include "ui/boxes/peer_qr_box.h"
#include "main/main_session.h" #include "main/main_session.h"
#include "mtproto/mtproto_config.h" #include "mtproto/mtproto_config.h"
#include "data/data_download_manager.h" #include "data/data_download_manager.h"
@ -388,6 +390,23 @@ void WrapWidget::setupTopBarMenuToggle() {
addProfileCallsButton(); addProfileCallsButton();
} else if (section.type() == Section::Type::Settings) { } else if (section.type() == Section::Type::Settings) {
addTopBarMenuButton(); addTopBarMenuButton();
if (section.settingsType() == ::Settings::Information::Id()
|| section.settingsType() == ::Settings::Main::Id()) {
const auto controller = _controller->parentController();
const auto self = controller->session().user();
if (!self->username().isEmpty()) {
const auto show = controller->uiShow();
const auto &st = (wrap() == Wrap::Layer)
? st::infoLayerTopBarQr
: st::infoTopBarQr;
const auto button = _topBar->addButton(
base::make_unique_q<Ui::IconButton>(_topBar, st));
button->addClickHandler([show, self] {
show->show(
Box(Ui::FillPeerQrBox, self, std::nullopt, nullptr));
});
}
}
} else if (section.type() == Section::Type::Downloads) { } else if (section.type() == Section::Type::Downloads) {
auto &manager = Core::App().downloadManager(); auto &manager = Core::App().downloadManager();
rpl::merge( rpl::merge(

View file

@ -80,24 +80,6 @@ struct AttachWebViewBot {
bool requestWriteAccess : 1 = false; bool requestWriteAccess : 1 = false;
}; };
struct AddToMenuOpenAttach {
QString startCommand;
PeerTypes chooseTypes;
};
struct AddToMenuOpenMenu {
QString startCommand;
};
struct AddToMenuOpenApp {
not_null<BotAppData*> app;
QString startCommand;
};
struct AddToMenuOpen : std::variant<
AddToMenuOpenAttach,
AddToMenuOpenMenu,
AddToMenuOpenApp> {
using variant::variant;
};
struct WebViewSourceButton { struct WebViewSourceButton {
bool simple = false; bool simple = false;

View file

@ -1638,6 +1638,17 @@ Link::Link(
} }
_links.push_back(LinkEntry(url, entityText)); _links.push_back(LinkEntry(url, entityText));
} }
if (_links.empty()) {
if (const auto media = parent->media()) {
if (const auto webpage = media->webpage()) {
if (!webpage->displayUrl.isEmpty()
&& !webpage->url.isEmpty()) {
_links.push_back(
LinkEntry(webpage->displayUrl, webpage->url));
}
}
}
}
while (lnk > 0 && till > from) { while (lnk > 0 && till > from) {
--lnk; --lnk;
auto &entity = entities.at(lnk); auto &entity = entities.at(lnk);

View file

@ -124,8 +124,9 @@ void Paint(
const auto gradientRotation = int(angle / 45.) * 45; const auto gradientRotation = int(angle / 45.) * 45;
const auto gradientRotationAdd = angle - gradientRotation; const auto gradientRotationAdd = angle - gradientRotation;
const auto textAdditionalWidth = backgroundMargins.left();
auto back = Images::GenerateGradient( auto back = Images::GenerateGradient(
qrRect.size(), qrRect.size() + QSize(textAdditionalWidth, 0),
backgroundColors, backgroundColors,
gradientRotation, gradientRotation,
1. - (gradientRotationAdd / 45.)); 1. - (gradientRotationAdd / 45.));
@ -151,7 +152,7 @@ void Paint(
p.drawImage(qrRect, qrImage); p.drawImage(qrRect, qrImage);
if (textMaxHeight) { if (textMaxHeight) {
p.drawImage( p.drawImage(
qrRect.x(), qrRect.x() - textAdditionalWidth / 2,
rect::bottom(qrRect) rect::bottom(qrRect)
+ ((rect::bottom(roundedRect) - rect::bottom(qrRect)) + ((rect::bottom(roundedRect) - rect::bottom(qrRect))
- textMaxHeight) / 2, - textMaxHeight) / 2,
@ -238,9 +239,9 @@ not_null<Ui::RpWidget*> PrepareQrWidget(
aboutLabel->setText(about); aboutLabel->setText(about);
aboutLabel->resizeToWidth(resultWidth); aboutLabel->resizeToWidth(resultWidth);
} }
const auto qrWidth = state->qrImage.width() const auto textMaxWidth = state->backgroundMargins.left()
/ style::DevicePixelRatio(); + (state->qrImage.width() / style::DevicePixelRatio());
const auto lines = int(state->textWidth / qrWidth) + 1; const auto lines = int(state->textWidth / textMaxWidth) + 1;
state->textMaxHeight = state->textWidth ? (font->height * lines) : 0; state->textMaxHeight = state->textWidth ? (font->height * lines) : 0;
const auto whiteMargins = RoundedMargins( const auto whiteMargins = RoundedMargins(
state->backgroundMargins, state->backgroundMargins,
@ -486,14 +487,13 @@ void FillPeerQrBox(
}) | ranges::views::filter([](const Colors &colors) { }) | ranges::views::filter([](const Colors &colors) {
return !colors.empty(); return !colors.empty();
}) | ranges::to_vector; }) | ranges::to_vector;
colorsCollection.insert( Expects(!colorsCollection.empty());
colorsCollection.begin(), colorsCollection[0] = Colors{
Colors{ st::premiumButtonBg1->c,
st::premiumButtonBg1->c, st::premiumButtonBg1->c,
st::premiumButtonBg1->c, st::premiumButtonBg2->c,
st::premiumButtonBg2->c, st::premiumButtonBg3->c,
st::premiumButtonBg3->c, };
});
// colorsCollection.push_back(Colors{ // colorsCollection.push_back(Colors{
// st::creditsBg1->c, // st::creditsBg1->c,
// st::creditsBg2->c, // st::creditsBg2->c,
@ -792,8 +792,9 @@ void FillPeerQrBox(
Qr::Redundancy::Default), Qr::Redundancy::Default),
introQrPixel, introQrPixel,
qrMaxSize); qrMaxSize);
const auto qrWidth = qrImage.width() / style::DevicePixelRatio(); const auto textMaxWidth = backgroundMargins.left()
const auto lines = int(textWidth / qrWidth) + 1; + (qrImage.width() / style::DevicePixelRatio());
const auto lines = int(textWidth / textMaxWidth) + 1;
const auto textMaxHeight = textWidth ? font->height * lines : 0; const auto textMaxHeight = textWidth ? font->height * lines : 0;
const auto whiteMargins = RoundedMargins( const auto whiteMargins = RoundedMargins(

View file

@ -169,10 +169,12 @@ void ShowCallsBox(not_null<Window::SessionController*> window) {
showSettings, showSettings,
&st::menuIconSettings); &st::menuIconSettings);
if (state->callsDelegate.peerListFullRowsCount() > 0) { if (state->callsDelegate.peerListFullRowsCount() > 0) {
state->menu->addAction( Ui::Menu::CreateAddActionCallback(state->menu)({
tr::lng_call_box_clear_all(tr::now), .text = tr::lng_call_box_clear_all(tr::now),
clearAll, .handler = clearAll,
&st::menuIconDelete); .icon = &st::menuIconDeleteAttention,
.isAttention = true,
});
} }
state->menu->popup(QCursor::pos()); state->menu->popup(QCursor::pos());
return true; return true;

View file

@ -1,7 +1,7 @@
AppVersion 5005003 AppVersion 5005004
AppVersionStrMajor 5.5 AppVersionStrMajor 5.5
AppVersionStrSmall 5.5.3 AppVersionStrSmall 5.5.4
AppVersionStr 5.5.3 AppVersionStr 5.5.4
BetaChannel 0 BetaChannel 0
AlphaVersion 0 AlphaVersion 0
AppVersionOriginal 5.5.3 AppVersionOriginal 5.5.4

View file

@ -1,3 +1,9 @@
5.5.4 (12.09.24)
- Fix channel updates stopping after difference request failing.
- Add QR code generation for your username in Settings.
- Fix swipe-to-reply gestures stopping. (macOS)
5.5.3 (10.09.24) 5.5.3 (10.09.24)
- Fix custom emoji sending. - Fix custom emoji sending.