diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml
index dbaeaa5bf..3701e55ec 100644
--- a/Telegram/Resources/uwp/AppX/AppxManifest.xml
+++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml
@@ -10,7 +10,7 @@
+ Version="5.5.5.0" />
Telegram Desktop
Telegram Messenger LLP
diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc
index 921915532..df78b18a6 100644
--- a/Telegram/Resources/winrc/Telegram.rc
+++ b/Telegram/Resources/winrc/Telegram.rc
@@ -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"
diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc
index 18158d73e..0b54e9425 100644
--- a/Telegram/Resources/winrc/Updater.rc
+++ b/Telegram/Resources/winrc/Updater.rc
@@ -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"
diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp
index 897b03d66..eea4f6f35 100644
--- a/Telegram/SourceFiles/api/api_updates.cpp
+++ b/Telegram/SourceFiles/api/api_updates.cpp
@@ -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 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 peer) const {
+ return ranges::contains(
+ _activeChats,
+ peer.get(),
+ [](const auto &pair) { return pair.second.peer; });
+}
+
void Updates::requestChannelRangeDifference(not_null history) {
Expects(history->peer->isChannel());
diff --git a/Telegram/SourceFiles/api/api_updates.h b/Telegram/SourceFiles/api/api_updates.h
index c028ae75a..654e36b51 100644
--- a/Telegram/SourceFiles/api/api_updates.h
+++ b/Telegram/SourceFiles/api/api_updates.h
@@ -63,6 +63,7 @@ public:
void requestChannelRangeDifference(not_null history);
void addActiveChat(rpl::producer chat);
+ [[nodiscard]] bool inActiveChats(not_null peer) const;
private:
enum class ChannelDifferenceRequest {
diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp
index 12392a71f..63e1b6604 100644
--- a/Telegram/SourceFiles/apiwrap.cpp
+++ b/Telegram/SourceFiles/apiwrap.cpp
@@ -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()) {
diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp
index ac8e7dea1..c330b9fb7 100644
--- a/Telegram/SourceFiles/chat_helpers/message_field.cpp
+++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp
@@ -147,13 +147,24 @@ void EditLinkBox(
object_ptr(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(
content,
fieldSt,
tr::lng_formatting_link_url(),
- startLink.trimmed()));
+ link));
url->heightValue(
) | rpl::start_with_next([placeholder](int height) {
placeholder->resize(placeholder->width(), height);
diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h
index 6a3072e98..841442ec2 100644
--- a/Telegram/SourceFiles/core/version.h
+++ b/Telegram/SourceFiles/core/version.h
@@ -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;
diff --git a/Telegram/SourceFiles/data/data_channel.h b/Telegram/SourceFiles/data/data_channel.h
index 90f9e2b8d..90f3b9274 100644
--- a/Telegram/SourceFiles/data/data_channel.h
+++ b/Telegram/SourceFiles/data/data_channel.h
@@ -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 {
diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp
index 94b0f7201..6c6e04c99 100644
--- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp
+++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp
@@ -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;
}
diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp
index 8808f3200..49f1b8b2c 100644
--- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp
+++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp
@@ -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 topic) {
st::infoTopicCover.photo.size);
}
result->setRepaintCallback(_update);
+ _playerUsesTextColor = media->owner()->emojiUsesTextColor();
return result;
});
}) | rpl::flatten_latest(
diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.h b/Telegram/SourceFiles/info/profile/info_profile_cover.h
index f6bf44453..d6337cfa2 100644
--- a/Telegram/SourceFiles/info/profile/info_profile_cover.h
+++ b/Telegram/SourceFiles/info/profile/info_profile_cover.h
@@ -71,6 +71,7 @@ private:
Fn _paused;
Fn _update;
std::shared_ptr _player;
+ bool _playerUsesTextColor = false;
QImage _image;
rpl::lifetime _lifetime;
diff --git a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp
index 9afde3b19..008910300 100644
--- a/Telegram/SourceFiles/platform/linux/launcher_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/launcher_linux.cpp
@@ -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());
}
diff --git a/Telegram/build/version b/Telegram/build/version
index 69b99552b..d4f4c170a 100644
--- a/Telegram/build/version
+++ b/Telegram/build/version
@@ -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
diff --git a/changelog.txt b/changelog.txt
index 2bd1bca36..c4bc127b5 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -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.