Skip to content

Commit

Permalink
Updated to 5.7.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Nov 15, 2024
2 parents 886d6c9 + 7dd1e9b commit 0f0e3e5
Show file tree
Hide file tree
Showing 36 changed files with 290 additions and 92 deletions.
1 change: 1 addition & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -5085,6 +5085,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_outdated_now" = "So Telegram Desktop can update to newer versions.";

"lng_filters_all" = "All chats";
"lng_filters_all_short" = "All";
"lng_filters_setup" = "Edit";
"lng_filters_title" = "Folders";
"lng_filters_subtitle" = "My folders";
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.7.3.0" />
Version="5.7.4.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,7,3,0
PRODUCTVERSION 5,7,3,0
FILEVERSION 5,7,4,0
PRODUCTVERSION 5,7,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "5.7.3.0"
VALUE "FileVersion", "5.7.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.7.3.0"
VALUE "ProductVersion", "5.7.4.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,7,3,0
PRODUCTVERSION 5,7,3,0
FILEVERSION 5,7,4,0
PRODUCTVERSION 5,7,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", ""
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "5.7.3.0"
VALUE "FileVersion", "5.7.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.7.3.0"
VALUE "ProductVersion", "5.7.4.0"
END
END
BLOCK "VarFileInfo"
Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/api/api_credits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ constexpr auto kTransactionsLimit = 100;
.balance = status.data().vbalance().v,
.subscriptionsMissingBalance
= status.data().vsubscriptions_missing_balance().value_or_empty(),
.allLoaded = !status.data().vnext_offset().has_value(),
.allLoaded = !status.data().vnext_offset().has_value()
&& !status.data().vsubscriptions_next_offset().has_value(),
.token = qs(status.data().vnext_offset().value_or_empty()),
.tokenSubscriptions = qs(
status.data().vsubscriptions_next_offset().value_or_empty()),
Expand Down
13 changes: 8 additions & 5 deletions Telegram/SourceFiles/boxes/peer_list_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,15 @@ void PeerListBox::searchQueryChanged(const QString &query) {
scrollToY(0);
const auto isEmpty = content()->searchQueryChanged(query);
if (_specialTabsMode.enabled) {
const auto was = _specialTabsMode.searchIsActive;
_specialTabsMode.searchIsActive = !isEmpty;
if (_specialTabsMode.searchIsActive) {
_specialTabsMode.topSkip = _addedTopScrollSkip;
setAddedTopScrollSkip(0);
} else {
setAddedTopScrollSkip(_specialTabsMode.topSkip);
if (was != _specialTabsMode.searchIsActive) {
if (_specialTabsMode.searchIsActive) {
_specialTabsMode.topSkip = _addedTopScrollSkip;
setAddedTopScrollSkip(0);
} else {
setAddedTopScrollSkip(_specialTabsMode.topSkip);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void ProcessFullPhoto(
) | rpl::map([=] {
const auto user = peer->asUser();
const auto username = peer->username();
const auto channelId = user->personalChannelId();
const auto channelId = user ? user->personalChannelId() : 0;
const auto channel = channelId
? user->owner().channel(channelId).get()
: nullptr;
Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/boxes/share_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,8 @@ void ShareBox::Inner::applyChatFilter(FilterId id) {
const auto addList = [&](not_null<Dialogs::IndexedList*> list) {
for (const auto &row : list->all()) {
if (const auto history = row->history()) {
if (_descriptor.filterCallback(history)) {
if (history->asForum()
|| _descriptor.filterCallback(history)) {
_customChatsIndexed->addToEnd(history);
}
}
Expand Down
14 changes: 9 additions & 5 deletions Telegram/SourceFiles/core/core_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ QByteArray Settings::serialize() const {
+ Serialize::stringSize(_customFontFamily)
+ sizeof(qint32) * 3
+ Serialize::bytearraySize(_tonsiteStorageToken)
+ sizeof(qint32) * 6;
+ sizeof(qint32) * 7;

// Fork Settings.
size += sizeof(qint32);
Expand Down Expand Up @@ -336,7 +336,7 @@ QByteArray Settings::serialize() const {
<< qint32(_thirdSectionExtendedBy)
<< qint32(_notifyFromAll ? 1 : 0)
<< qint32(_nativeWindowFrame.current() ? 1 : 0)
<< qint32(_systemDarkModeEnabled.current() ? 1 : 0)
<< qint32(0) // Legacy system dark mode
<< _cameraDeviceId.current()
<< qint32(_ipRevealWarning ? 1 : 0)
<< qint32(_groupCallPushToTalk ? 1 : 0)
Expand Down Expand Up @@ -427,7 +427,8 @@ QByteArray Settings::serialize() const {
<< qint32(_skipToastsInFocus ? 1 : 0)
<< qint32(_recordVideoMessages ? 1 : 0)
<< SerializeVideoQuality(_videoQuality)
<< qint32(_ivZoom.current());
<< qint32(_ivZoom.current())
<< qint32(_systemDarkModeEnabled.current() ? 1 : 0);
}

Ensures(result.size() == size);
Expand Down Expand Up @@ -517,6 +518,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
qint32 notifyFromAll = _notifyFromAll ? 1 : 0;
qint32 nativeWindowFrame = _nativeWindowFrame.current() ? 1 : 0;
qint32 systemDarkModeEnabled = _systemDarkModeEnabled.current() ? 1 : 0;
qint32 legacySystemDarkModeEnabled = 0;
qint32 ipRevealWarning = _ipRevealWarning ? 1 : 0;
qint32 groupCallPushToTalk = _groupCallPushToTalk ? 1 : 0;
QByteArray groupCallPushToTalkShortcut = _groupCallPushToTalkShortcut;
Expand Down Expand Up @@ -663,7 +665,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
stream >> nativeWindowFrame;
}
if (!stream.atEnd()) {
stream >> systemDarkModeEnabled;
stream >> legacySystemDarkModeEnabled;
}
if (!stream.atEnd()) {
stream >> cameraDeviceId;
Expand Down Expand Up @@ -906,6 +908,9 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
if (!stream.atEnd()) {
stream >> ivZoom;
}
if (!stream.atEnd()) {
stream >> systemDarkModeEnabled;
}
if (stream.status() != QDataStream::Ok) {
LOG(("App Error: "
"Bad data for Core::Settings::constructFromSerialized()"));
Expand Down Expand Up @@ -1522,7 +1527,6 @@ void Settings::resetOnLastLogout() {
_thirdColumnWidth = kDefaultThirdColumnWidth; // p-w
_notifyFromAll = true;
_tabbedReplacedWithInfo = false; // per-window
_systemDarkModeEnabled = false;
_hiddenGroupCallTooltips = 0;
_storiesClickTooltipHidden = false;
_ttlVoiceClickTooltipHidden = false;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/core/core_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ class Settings final {
bool _notifyFromAll = true;
rpl::variable<bool> _nativeWindowFrame = false;
rpl::variable<std::optional<bool>> _systemDarkMode = std::nullopt;
rpl::variable<bool> _systemDarkModeEnabled = false;
rpl::variable<bool> _systemDarkModeEnabled = true;
rpl::variable<WindowTitleContent> _windowTitleContent;
WindowPosition _windowPosition; // per-window
bool _disableOpenGL = false;
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/core/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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 = 5007003;
constexpr auto AppVersionStr = "5.7.3";
constexpr auto AppVersion = 5007004;
constexpr auto AppVersionStr = "5.7.4";
constexpr auto AppBetaVersion = true;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
15 changes: 10 additions & 5 deletions Telegram/SourceFiles/data/data_peer_bot_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ ChatBotCommands::Changed ChatBotCommands::update(
clear();
} else {
for (const auto &commands : list) {
auto &value = operator[](commands.userId);
changed |= commands.commands.empty()
? remove(commands.userId)
: !ranges::equal(value, commands.commands);
value = commands.commands;
if (commands.commands.empty()) {
changed |= remove(commands.userId);
} else {
auto &value = operator[](commands.userId);
const auto isEqual = ranges::equal(value, commands.commands);
changed |= !isEqual;
if (!isEqual) {
value = commands.commands;
}
}
}
}
return changed;
Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/dialogs/dialogs.style
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,10 @@ dialogsSearchTabs: SettingsSlider(defaultSettingsSlider) {
}
dialogsSearchTabsPadding: 8px;

chatsFiltersTabs: SettingsSlider(dialogsSearchTabs) {
rippleBottomSkip: 0px;
}

dialogsStoriesList: DialogsStoriesList {
small: dialogsStories;
full: dialogsStoriesFull;
Expand Down
20 changes: 19 additions & 1 deletion Telegram/SourceFiles/dialogs/dialogs_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,10 +1316,27 @@ void Widget::updateHasFocus(not_null<QWidget*> focused) {
}

void Widget::toggleFiltersMenu(bool enabled) {
if (_layout == Layout::Child) {
enabled = false;
}
if (!enabled == !_chatFilters) {
return;
} else if (enabled) {
_chatFilters = base::make_unique_q<Ui::RpWidget>(this);
class NoScrollPropagationWidget final : public Ui::RpWidget {
public:
using Ui::RpWidget::RpWidget;

protected:
void touchEvent(QTouchEvent *e) {
e->accept();
}
void wheelEvent(QWheelEvent *e) override final {
e->accept();
}

};

_chatFilters = base::make_unique_q<NoScrollPropagationWidget>(this);
const auto raw = _chatFilters.get();
const auto inner = Ui::AddChatFiltersTabsStrip(
_chatFilters.get(),
Expand All @@ -1329,6 +1346,7 @@ void Widget::toggleFiltersMenu(bool enabled) {
controller()->setActiveChatsFilter(id);
}
},
controller(),
true);
raw->show();
raw->stackUnder(_scroll);
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/dialogs/dialogs_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class Widget final : public Window::AbstractSectionWidget {
bool _dragForward = false;
base::Timer _chooseByDragTimer;

Layout _layout = Layout::Main;
const Layout _layout = Layout::Main;
int _narrowWidth = 0;
object_ptr<Ui::RpWidget> _searchControls;
object_ptr<HistoryView::TopBarWidget> _subsectionTopBar = { nullptr };
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/history/history_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7757,12 +7757,12 @@ void HistoryWidget::createSponsoredMessageBar() {
session().sponsoredMessages().itemRemoved(
maybeFullId
) | rpl::start_with_next([this] {
_sponsoredMessageBar->toggle(false, anim::type::normal);
_sponsoredMessageBar->shownValue() | rpl::filter(
!rpl::mappers::_1
) | rpl::start_with_next([this] {
_sponsoredMessageBar = nullptr;
}, _sponsoredMessageBar->lifetime());
_sponsoredMessageBar->toggle(false, anim::type::normal);
}, _sponsoredMessageBar->lifetime());

if (maybeFullId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3397,6 +3397,10 @@ Fn<void()> ComposeControls::restoreTextCallback(
});
}

Ui::InputField *ComposeControls::fieldForMention() const {
return _writeRestriction.current() ? nullptr : _field.get();
}

TextWithEntities ComposeControls::prepareTextForEditMsg() const {
if (!_history) {
return {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ class ComposeControls final {

Fn<void()> restoreTextCallback(const QString &insertTextOnCancel) const;

[[nodiscard]] Ui::InputField *fieldForMention() const;

private:
enum class TextUpdateEvent {
SaveDraft = (1 << 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class Item final
bool listShowReactPremiumError(
not_null<HistoryItem*> item,
const Data::ReactionId &id) override;
base::unique_qptr<Ui::PopupMenu> listFillSenderUserpicMenu(
PeerId userpicPeerId) override;
void listWindowSetInnerFocus() override;
bool listAllowsDragForward() override;
void listLaunchDrag(
Expand Down Expand Up @@ -828,6 +830,11 @@ bool Item::listShowReactPremiumError(
return false;
}

base::unique_qptr<Ui::PopupMenu> Item::listFillSenderUserpicMenu(
PeerId userpicPeerId) {
return nullptr;
}

void Item::listWindowSetInnerFocus() {
}

Expand Down
Loading

0 comments on commit 0f0e3e5

Please sign in to comment.