Merge tag 'v5.5.5' into dev

# Conflicts:
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/core/version.h
This commit is contained in:
AlexeyZavar 2024-09-27 20:40:18 +03:00
commit 976db74ece
15 changed files with 72 additions and 31 deletions

View file

@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.5.4.0" />
Version="5.5.5.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,5,4,0
PRODUCTVERSION 5,5,4,0
FILEVERSION 5,5,5,0
PRODUCTVERSION 5,5,5,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Radolyn Labs"
VALUE "FileDescription", "AyuGram Desktop"
VALUE "FileVersion", "5.5.4.0"
VALUE "FileVersion", "5.5.5.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "AyuGram Desktop"
VALUE "ProductVersion", "5.5.4.0"
VALUE "ProductVersion", "5.5.5.0"
END
END
BLOCK "VarFileInfo"

View file

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

View file

@ -421,13 +421,12 @@ void Updates::channelDifferenceDone(
"{ good - after not final channelDifference was received }%1"
).arg(_session->mtp().isTestMode() ? " TESTMODE" : ""));
getChannelDifference(channel);
} else if (ranges::contains(
_activeChats,
channel,
[](const auto &pair) { return pair.second.peer; })) {
channel->ptsWaitingForShortPoll(timeout
} else if (inActiveChats(channel)) {
channel->ptsSetWaitingForShortPoll(timeout
? (timeout * crl::time(1000))
: kWaitForChannelGetDifference);
} else {
channel->ptsSetWaitingForShortPoll(-1);
}
}
@ -747,16 +746,32 @@ void Updates::addActiveChat(rpl::producer<PeerData*> chat) {
std::move(
chat
) | rpl::start_with_next_done([=](PeerData *peer) {
_activeChats[key].peer = peer;
if (const auto channel = peer ? peer->asChannel() : nullptr) {
channel->ptsWaitingForShortPoll(
kWaitForChannelGetDifference);
auto &active = _activeChats[key];
const auto was = active.peer;
if (was != peer) {
active.peer = peer;
if (const auto channel = was ? was->asChannel() : nullptr) {
if (!inActiveChats(channel)) {
channel->ptsSetWaitingForShortPoll(-1);
}
}
if (const auto channel = peer ? peer->asChannel() : nullptr) {
channel->ptsSetWaitingForShortPoll(
kWaitForChannelGetDifference);
}
}
}, [=] {
_activeChats.erase(key);
}, _activeChats[key].lifetime);
}
bool Updates::inActiveChats(not_null<PeerData*> peer) const {
return ranges::contains(
_activeChats,
peer.get(),
[](const auto &pair) { return pair.second.peer; });
}
void Updates::requestChannelRangeDifference(not_null<History*> history) {
Expects(history->peer->isChannel());

View file

@ -63,6 +63,7 @@ public:
void requestChannelRangeDifference(not_null<History*> history);
void addActiveChat(rpl::producer<PeerData*> chat);
[[nodiscard]] bool inActiveChats(not_null<PeerData*> peer) const;
private:
enum class ChannelDifferenceRequest {

View file

@ -2072,7 +2072,7 @@ void ApiWrap::deleteHistory(
}
if (const auto channel = peer->asChannel()) {
if (!justClear && !revoke) {
channel->ptsWaitingForShortPoll(-1);
channel->ptsSetWaitingForShortPoll(-1);
leaveChannel(channel);
} else {
if (const auto migrated = peer->migrateFrom()) {

View file

@ -147,13 +147,24 @@ void EditLinkBox(
object_ptr<Ui::RpWidget>(content),
st::markdownLinkFieldPadding);
placeholder->setAttribute(Qt::WA_TransparentForMouseEvents);
const auto link = [&] {
if (!startLink.trimmed().isEmpty()) {
return startLink.trimmed();
}
const auto clipboard = QGuiApplication::clipboard()->text().trimmed();
if (clipboard.startsWith("http://")
|| clipboard.startsWith("https://")) {
return clipboard;
}
return QString();
}();
const auto url = Ui::AttachParentChild(
content,
object_ptr<Ui::InputField>(
content,
fieldSt,
tr::lng_formatting_link_url(),
startLink.trimmed()));
link));
url->heightValue(
) | rpl::start_with_next([placeholder](int height) {
placeholder->resize(placeholder->width(), height);

View file

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

View file

@ -423,7 +423,7 @@ public:
return _ptsWaiter.setRequesting(isRequesting);
}
// < 0 - not waiting
void ptsWaitingForShortPoll(int32 ms) {
void ptsSetWaitingForShortPoll(int32 ms) {
return _ptsWaiter.setWaitingForShortPoll(this, ms);
}
[[nodiscard]] bool ptsWaitingForSkipped() const {

View file

@ -908,7 +908,8 @@ void RepliesWidget::setupSwipeReply() {
return result;
}
const auto view = _inner->lookupItemByY(cursorTop);
if (!view->data()->isRegular()
if (!view
|| !view->data()->isRegular()
|| view->data()->isService()) {
return result;
}

View file

@ -135,9 +135,12 @@ void TopicIconView::paintInRect(QPainter &p, QRect rect) {
image);
};
if (_player && _player->ready()) {
const auto colored = _playerUsesTextColor
? st::windowFg->c
: QColor(0, 0, 0, 0);
paint(_player->frame(
st::infoTopicCover.photo.size,
st::windowFg->c,
colored,
false,
crl::now(),
_paused()).image);
@ -200,6 +203,7 @@ void TopicIconView::setupPlayer(not_null<Data::ForumTopic*> topic) {
st::infoTopicCover.photo.size);
}
result->setRepaintCallback(_update);
_playerUsesTextColor = media->owner()->emojiUsesTextColor();
return result;
});
}) | rpl::flatten_latest(

View file

@ -71,6 +71,7 @@ private:
Fn<bool()> _paused;
Fn<void()> _update;
std::shared_ptr<StickerPlayer> _player;
bool _playerUsesTextColor = false;
QImage _image;
rpl::lifetime _lifetime;

View file

@ -49,7 +49,9 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
const auto launching = justRelaunch
? (cExeDir() + cExeName())
: cWriteProtected()
? u"pkexec"_q
? GLib::find_program_in_path("run0")
? u"run0"_q
: u"pkexec"_q
: (cExeDir() + u"Updater"_q);
argumentsList.push_back(launching.toStdString());
@ -61,7 +63,7 @@ bool Launcher::launchUpdater(UpdaterLaunch action) {
: launching;
argumentsList.push_back(argv0.toStdString());
} else if (cWriteProtected()) {
// Elevated process that pkexec should launch.
// Elevated process that run0/pkexec should launch.
const auto elevated = cWorkingDir() + u"tupdates/temp/Updater"_q;
argumentsList.push_back(elevated.toStdString());
}

View file

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

View file

@ -1,3 +1,9 @@
5.5.5 (13.09.24)
- Suggest URL from clipboard when creating a custom link.
- Fix animated topic icons in topic info page.
- Fix excessive getChannelDifference requests.
5.5.4 (12.09.24)
- Fix channel updates stopping after difference request failing.