From 606a90a4ace9571b0842d941cfcbcaaa11487701 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Oct 2019 10:02:28 +0300 Subject: [PATCH 1/5] Fix crash in emoji suggestions. Fixes #6636. --- .../SourceFiles/chat_helpers/emoji_keywords.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp b/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp index 92653bcac..a1d6bc3a0 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_keywords.cpp @@ -168,11 +168,20 @@ void AppendFoundEmoji( std::vector &result, const QString &label, const std::vector &list) { + // It is important that the 'result' won't relocate while inserting. + result.reserve(result.size() + list.size()); + const auto alreadyBegin = result.data(); + const auto alreadyEnd = alreadyBegin + result.size(); + auto &&add = ranges::view::all( list ) | ranges::view::filter([&](const LangPackEmoji &entry) { - const auto i = ranges::find(result, entry.emoji, &Result::emoji); - return (i == end(result)); + const auto i = ranges::find( + alreadyBegin, + alreadyEnd, + entry.emoji, + &Result::emoji); + return (i == alreadyEnd); }) | ranges::view::transform([&](const LangPackEmoji &entry) { return Result{ entry.emoji, label, entry.text }; }); From 4e7946d03e317c3eee803d5342168c72eec60166 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Oct 2019 12:34:58 +0300 Subject: [PATCH 2/5] Allow scales below 100. Fixes #6632. --- Telegram/SourceFiles/ui/style/style_core_scale.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/style/style_core_scale.h b/Telegram/SourceFiles/ui/style/style_core_scale.h index ca7120a5c..c5396ff6b 100644 --- a/Telegram/SourceFiles/ui/style/style_core_scale.h +++ b/Telegram/SourceFiles/ui/style/style_core_scale.h @@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace style { inline constexpr auto kScaleAuto = 0; -inline constexpr auto kScaleMin = 100; +inline constexpr auto kScaleMin = 75; inline constexpr auto kScaleDefault = 100; inline constexpr auto kScaleMax = 300; From 3779ad46caf47acdb69f5d602aa0522bd3a314c8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Oct 2019 12:37:00 +0300 Subject: [PATCH 3/5] Fix crash in pre-launch logging. Fixes #6635. --- Telegram/SourceFiles/ui/ui_integration.cpp | 8 ++++++-- Telegram/SourceFiles/ui/ui_integration.h | 1 + Telegram/SourceFiles/ui/ui_log.cpp | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/ui/ui_integration.cpp b/Telegram/SourceFiles/ui/ui_integration.cpp index c3609e23e..a06424ab8 100644 --- a/Telegram/SourceFiles/ui/ui_integration.cpp +++ b/Telegram/SourceFiles/ui/ui_integration.cpp @@ -27,12 +27,16 @@ Integration &Integration::Instance() { return *IntegrationInstance; } +bool Integration::Exists() { + return (IntegrationInstance != nullptr); +} + void Integration::textActionsUpdated() { } -void Integration::activationFromTopPanel() { +void Integration::activationFromTopPanel() { } - + std::shared_ptr Integration::createLinkHandler( EntityType type, const QString &text, diff --git a/Telegram/SourceFiles/ui/ui_integration.h b/Telegram/SourceFiles/ui/ui_integration.h index 01c1f8814..778422cf0 100644 --- a/Telegram/SourceFiles/ui/ui_integration.h +++ b/Telegram/SourceFiles/ui/ui_integration.h @@ -28,6 +28,7 @@ class Integration { public: static void Set(not_null instance); static Integration &Instance(); + static bool Exists(); virtual void postponeCall(FnMut &&callable) = 0; virtual void registerLeaveSubscription(not_null widget) = 0; diff --git a/Telegram/SourceFiles/ui/ui_log.cpp b/Telegram/SourceFiles/ui/ui_log.cpp index 578ce51a7..79e8e451a 100644 --- a/Telegram/SourceFiles/ui/ui_log.cpp +++ b/Telegram/SourceFiles/ui/ui_log.cpp @@ -12,7 +12,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Ui { void WriteLogEntry(const QString &message) { - Integration::Instance().writeLogEntry(message); + if (Integration::Exists()) { + Integration::Instance().writeLogEntry(message); + } } } // namespace Ui From 9773563926440ba980f7dbbb790a55512832086c Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Oct 2019 13:25:05 +0300 Subject: [PATCH 4/5] Fix history geometry update being lost. Fixes #6629. --- Telegram/SourceFiles/history/history_widget.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index d7de50fde..320d11a64 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3163,8 +3163,8 @@ void HistoryWidget::doneShow() { updateControlsVisibility(); if (!_historyInited) { updateHistoryGeometry(true); - } else if (hasPendingResizedItems()) { - updateHistoryGeometry(); + } else { + handlePendingHistoryUpdate(); } preloadHistoryIfNeeded(); if (App::wnd()) { @@ -5006,11 +5006,15 @@ int HistoryWidget::countAutomaticScrollTop() { return qMin(result, _scroll->scrollTopMax()); } -void HistoryWidget::updateHistoryGeometry(bool initial, bool loadedDown, const ScrollChange &change) { +void HistoryWidget::updateHistoryGeometry( + bool initial, + bool loadedDown, + const ScrollChange &change) { if (!_history || (initial && _historyInited) || (!initial && !_historyInited)) { return; } if (_firstLoadRequest || _a_show.animating()) { + _updateHistoryGeometryRequired = true; return; // scrollTopMax etc are not working after recountHistoryGeometry() } From dcf79df0b2eb0d8bc3757f44c43e62aef9d4fdee Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Oct 2019 13:26:39 +0300 Subject: [PATCH 5/5] Version 1.8.13. - Bug fixes and other minor improvements. --- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/core/version.h | 4 ++-- Telegram/build/version | 6 +++--- changelog.txt | 4 ++++ 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index c8751a93b..530165669 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="1.8.13.0" /> Telegram Desktop Telegram FZ-LLC diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index bebd6b9dc..a605dd0f9 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -33,8 +33,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,8,12,0 - PRODUCTVERSION 1,8,12,0 + FILEVERSION 1,8,13,0 + PRODUCTVERSION 1,8,13,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram FZ-LLC" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "1.8.12.0" + VALUE "FileVersion", "1.8.13.0" VALUE "LegalCopyright", "Copyright (C) 2014-2019" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.8.12.0" + VALUE "ProductVersion", "1.8.13.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index cdc81116a..bc05c7140 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -24,8 +24,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,8,12,0 - PRODUCTVERSION 1,8,12,0 + FILEVERSION 1,8,13,0 + PRODUCTVERSION 1,8,13,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -42,10 +42,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram FZ-LLC" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "1.8.12.0" + VALUE "FileVersion", "1.8.13.0" VALUE "LegalCopyright", "Copyright (C) 2014-2019" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.8.12.0" + VALUE "ProductVersion", "1.8.13.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 8580d1d5e..32f5657dd 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #define TDESKTOP_ALPHA_VERSION (0ULL) #endif // TDESKTOP_OFFICIAL_TARGET -constexpr auto AppVersion = 1008012; -constexpr auto AppVersionStr = "1.8.12"; +constexpr auto AppVersion = 1008013; +constexpr auto AppVersionStr = "1.8.13"; constexpr auto AppBetaVersion = false; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; diff --git a/Telegram/build/version b/Telegram/build/version index 2d9a30cb5..aec94f196 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,6 +1,6 @@ -AppVersion 1008012 +AppVersion 1008013 AppVersionStrMajor 1.8 -AppVersionStrSmall 1.8.12 -AppVersionStr 1.8.12 +AppVersionStrSmall 1.8.13 +AppVersionStr 1.8.13 BetaChannel 0 AlphaVersion 0 diff --git a/changelog.txt b/changelog.txt index 6a79a1504..b7f97921a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +1.8.13 (03.10.19) + +- Bug fixes and other minor improvements. + 1.8.12 (02.10.19) - Bug fixes and other minor improvements.