From 49e286b04cf9065628fde38c80496211752f140e Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 28 Mar 2020 03:27:30 +0300 Subject: [PATCH 01/24] Added scroll to active and not completely visible SideBarButtons. --- .../window/window_filters_menu.cpp | 28 +++++++++++++++++++ .../SourceFiles/window/window_filters_menu.h | 4 +++ 2 files changed, 32 insertions(+) diff --git a/Telegram/SourceFiles/window/window_filters_menu.cpp b/Telegram/SourceFiles/window/window_filters_menu.cpp index 216583320..36f9ad979 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.cpp +++ b/Telegram/SourceFiles/window/window_filters_menu.cpp @@ -122,8 +122,10 @@ void FiltersMenu::setup() { const auto j = _filters.find(_activeFilterId); if (j != end(_filters)) { j->second->setActive(true); + scrollToButton(j->second); } else if (!_activeFilterId) { _all->setActive(true); + scrollToButton(_all); } }, _outer.lifetime()); @@ -132,6 +134,32 @@ void FiltersMenu::setup() { }); } +void FiltersMenu::scrollToButton(not_null widget) { + const auto globalPosition = widget->mapToGlobal(QPoint(0, 0)); + const auto localTop = _scroll.mapFromGlobal(globalPosition).y(); + const auto localBottom = localTop + widget->height() - _scroll.height(); + const auto isTopEdge = (localTop < 0); + const auto isBottomEdge = (localBottom > 0); + if (!isTopEdge && !isBottomEdge) { + return; + } + + _scrollToAnimation.stop(); + const auto scrollTop = _scroll.scrollTop(); + const auto scrollTo = scrollTop + (isBottomEdge ? localBottom : localTop); + + auto scroll = [=] { + _scroll.scrollToY(qRound(_scrollToAnimation.value(scrollTo))); + }; + + _scrollToAnimation.start( + std::move(scroll), + scrollTop, + scrollTo, + st::slideDuration, + anim::sineInOut); +} + void FiltersMenu::refresh() { const auto filters = &_session->session().data().chatsFilters(); if (filters->list().empty() || _ignoreRefresh) { diff --git a/Telegram/SourceFiles/window/window_filters_menu.h b/Telegram/SourceFiles/window/window_filters_menu.h index 34aea5a6b..347aac0a9 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.h +++ b/Telegram/SourceFiles/window/window_filters_menu.h @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once +#include "ui/effects/animations.h" #include "ui/widgets/side_bar_button.h" #include "ui/widgets/scroll_area.h" #include "ui/wrap/vertical_layout.h" @@ -49,6 +50,7 @@ private: void showEditBox(FilterId id); void showRemoveBox(FilterId id); void remove(FilterId id); + void scrollToButton(not_null widget); const not_null _session; const not_null _parent; @@ -68,6 +70,8 @@ private: base::unique_qptr _popupMenu; + Ui::Animations::Simple _scrollToAnimation; + }; } // namespace Window From 09bc3eefdb2a311dfb5e7ec7e77393bf98900597 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 27 Mar 2020 20:51:09 +0300 Subject: [PATCH 02/24] Added ability to open folders with shortcuts. --- Telegram/SourceFiles/core/shortcuts.cpp | 24 ++++++++++++------- Telegram/SourceFiles/core/shortcuts.h | 24 +++++++++++++++++++ .../dialogs/dialogs_inner_widget.cpp | 19 +++++++++++++++ 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index 8437e0aa0..2a97f61ce 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -295,6 +295,8 @@ bool Manager::readCustomFile() { } void Manager::fillDefaults() { + const auto ctrl = Platform::IsMac() ? qsl("meta") : qsl("ctrl"); + set(qsl("ctrl+w"), Command::Close); set(qsl("ctrl+f4"), Command::Close); set(qsl("ctrl+l"), Command::Lock); @@ -316,15 +318,11 @@ void Manager::fillDefaults() { set(qsl("alt+down"), Command::ChatNext); set(qsl("ctrl+pgup"), Command::ChatPrevious); set(qsl("alt+up"), Command::ChatPrevious); - if (Platform::IsMac()) { - set(qsl("meta+tab"), Command::ChatNext); - set(qsl("meta+shift+tab"), Command::ChatPrevious); - set(qsl("meta+backtab"), Command::ChatPrevious); - } else { - set(qsl("ctrl+tab"), Command::ChatNext); - set(qsl("ctrl+shift+tab"), Command::ChatPrevious); - set(qsl("ctrl+backtab"), Command::ChatPrevious); - } + + set(qsl("%1+tab").arg(ctrl), Command::ChatNext); + set(qsl("%1+shift+tab").arg(ctrl), Command::ChatPrevious); + set(qsl("%1+backtab").arg(ctrl), Command::ChatPrevious); + set(qsl("ctrl+alt+home"), Command::ChatFirst); set(qsl("ctrl+alt+end"), Command::ChatLast); @@ -340,6 +338,14 @@ void Manager::fillDefaults() { set(qsl("ctrl+4"), Command::ChatPinned4); set(qsl("ctrl+5"), Command::ChatPinned5); + auto &&folders = ranges::view::zip( + kShowFolder, + ranges::view::ints(1, ranges::unreachable)); + + for (const auto [command, index] : folders) { + set(qsl("%1+shift+%2").arg(ctrl).arg(index > 9 ? 0 : index), command); + } + set(qsl("ctrl+0"), Command::ChatSelf); set(qsl("ctrl+9"), Command::ShowArchive); diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index 49e8c0d28..178433665 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -35,6 +35,17 @@ enum class Command { ChatPinned4, ChatPinned5, + ShowFolder1, + ShowFolder2, + ShowFolder3, + ShowFolder4, + ShowFolder5, + ShowFolder6, + ShowFolder7, + ShowFolder8, + ShowFolder9, + ShowFolder10, + ShowArchive, JustSendMessage, @@ -48,6 +59,19 @@ enum class Command { SupportHistoryForward, }; +constexpr auto kShowFolder = { + Command::ShowFolder1, + Command::ShowFolder2, + Command::ShowFolder3, + Command::ShowFolder4, + Command::ShowFolder5, + Command::ShowFolder6, + Command::ShowFolder7, + Command::ShowFolder8, + Command::ShowFolder9, + Command::ShowFolder10, +}; + [[nodiscard]] FnMut RequestHandler(Command command); class Request { diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 4c3587e52..53d1a7ec0 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -3034,6 +3034,25 @@ void InnerWidget::setupShortcuts() { return jumpToDialogRow({ row->key(), FullMsgId() }); }); } + + auto &&folders = ranges::view::zip( + Shortcuts::kShowFolder, + ranges::view::ints(0, ranges::unreachable)); + + for (const auto [command, index] : folders) { + request->check(command) && request->handle([=, index = index] { + const auto list = &session().data().chatsFilters().list(); + if (index >= list->size()) { + return false; + } + const auto filterId = list->at(index).id(); + _controller->setActiveChatsFilter((filterId == _filterId) + ? 0 + : filterId); + return true; + }); + } + if (session().supportMode() && row.key.history()) { request->check( Command::SupportScrollToCurrent From 7b583596ec9f53044c27b9d363ee35abbdf2173f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 28 Mar 2020 17:35:43 +0300 Subject: [PATCH 03/24] Added ability to scroll vertical layout during reordering. Updated lib_ui. --- Telegram/SourceFiles/window/window_filters_menu.cpp | 3 ++- Telegram/lib_ui | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/window/window_filters_menu.cpp b/Telegram/SourceFiles/window/window_filters_menu.cpp index 36f9ad979..cca1a88ac 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.cpp +++ b/Telegram/SourceFiles/window/window_filters_menu.cpp @@ -127,6 +127,7 @@ void FiltersMenu::setup() { _all->setActive(true); scrollToButton(_all); } + _reorder->finishReordering(); }, _outer.lifetime()); _menu.setClickedCallback([=] { @@ -198,7 +199,7 @@ void FiltersMenu::setupList() { -1, tr::lng_filters_setup(tr::now), Ui::FilterIcon::Setup); - _reorder = std::make_unique(_list); + _reorder = std::make_unique(_list, &_scroll); _reorder->updates( ) | rpl::start_with_next([=](Ui::VerticalLayoutReorder::Single data) { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 730816ef5..23009b62a 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 730816ef5219cbe7f1588bec2fe9adacd11739c8 +Subproject commit 23009b62add39f22cca27438a17f83762d8c2f94 From df290605f4f40c9a36d10015ca1b57a4c27136da Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 29 Mar 2020 02:04:20 +0300 Subject: [PATCH 04/24] Added ability to switch between folders with shortcuts. --- Telegram/SourceFiles/core/shortcuts.cpp | 3 ++ Telegram/SourceFiles/core/shortcuts.h | 3 ++ .../dialogs/dialogs_inner_widget.cpp | 29 +++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index 2a97f61ce..76bc4bd0d 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -346,6 +346,9 @@ void Manager::fillDefaults() { set(qsl("%1+shift+%2").arg(ctrl).arg(index > 9 ? 0 : index), command); } + set(qsl("%1+shift+down").arg(ctrl), Command::FolderNext); + set(qsl("%1+shift+up").arg(ctrl), Command::FolderPrevious); + set(qsl("ctrl+0"), Command::ChatSelf); set(qsl("ctrl+9"), Command::ShowArchive); diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index 178433665..fbce7c9ce 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -46,6 +46,9 @@ enum class Command { ShowFolder9, ShowFolder10, + FolderNext, + FolderPrevious, + ShowArchive, JustSendMessage, diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 53d1a7ec0..b719ac56a 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -3053,6 +3053,35 @@ void InnerWidget::setupShortcuts() { }); } + const auto nearFolder = [=](bool isNext) { + const auto id = _controller->activeChatsFilterCurrent(); + const auto list = &session().data().chatsFilters().list(); + const auto it = (id == 0) + ? begin(*list) - 1 + : ranges::find(*list, id, &Data::ChatFilter::id); + if (it == end(*list) && id != 0) { + return false; + } + const auto i = isNext ? 1 : -1; + const auto index = it - begin(*list) + i; + if (index >= (int)list->size() || index < -1) { + return false; + } + const auto filterId = (index == -1) + ? 0 + : list->at(index).id(); + _controller->setActiveChatsFilter(filterId); + return true; + }; + + request->check(Command::FolderNext) && request->handle([=] { + return nearFolder(true); + }); + + request->check(Command::FolderPrevious) && request->handle([=] { + return nearFolder(false); + }); + if (session().supportMode() && row.key.history()) { request->check( Command::SupportScrollToCurrent From 735f7709b92c2690ed263ce17d7c4b3b8a8d90be Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 12:28:41 +0400 Subject: [PATCH 05/24] Fix sending videos larger than 720p. --- Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp index b6bd69426..263ff877e 100644 --- a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp +++ b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp @@ -18,6 +18,7 @@ namespace { constexpr auto kSkipInvalidDataPackets = 10; constexpr auto kMaxInlineArea = 1280 * 720; +constexpr auto kMaxSendingArea = 3840 * 2160; // usual 4K // See https://github.com/telegramdesktop/tdesktop/issues/7225 constexpr auto kAlignImageBy = 64; @@ -60,7 +61,10 @@ ReaderImplementation::ReadResult FFMpegReaderImplementation::readNextFrame() { do { int res = avcodec_receive_frame(_codecContext, _frame.get()); if (res >= 0) { - if (_frame->width * _frame->height > kMaxInlineArea) { + const auto limit = (_mode == Mode::Inspecting) + ? kMaxSendingArea + : kMaxInlineArea; + if (_frame->width * _frame->height > limit) { return ReadResult::Error; } processReadFrame(); From b095091d0310648a8ad4ddf20c5d239be5159fb8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 12:33:55 +0400 Subject: [PATCH 06/24] Fix removing pinned dialog from folder. --- Telegram/SourceFiles/dialogs/dialogs_entry.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/dialogs/dialogs_entry.cpp b/Telegram/SourceFiles/dialogs/dialogs_entry.cpp index fa0919e67..f707b9928 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_entry.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_entry.cpp @@ -230,6 +230,10 @@ not_null Entry::addToChatList( void Entry::removeFromChatList( FilterId filterId, not_null list) { + if (isPinnedDialog(filterId)) { + owner().setChatPinned(_key, filterId, false); + } + const auto i = _chatListLinks.find(filterId); if (i == end(_chatListLinks)) { return; From 484ec06b0cefaf74d2ff4e82ae3b88bbdf3c7dd1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 12:52:20 +0400 Subject: [PATCH 07/24] Don't accidentally close edit folder box. --- Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp index f18f53c34..e58893c69 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp @@ -312,6 +312,7 @@ void EditExceptions( include ? rules.always() : rules.never()); const auto rawController = controller.get(); auto initBox = [=](not_null box) { + box->setCloseByOutsideClick(false); box->addButton(tr::lng_settings_save(), crl::guard(context, [=] { const auto peers = box->peerListCollectSelectedRows(); const auto rules = data->current(); From 0b13ee7f7db9e2c697dd788d12d72185fe8ab647 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 12:57:59 +0400 Subject: [PATCH 08/24] Scroll-by-drag in folders when reordering pinned. Fixes #7459. --- Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp | 3 ++- Telegram/SourceFiles/dialogs/dialogs_widget.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index b719ac56a..6ad29fc53 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -1247,7 +1247,8 @@ bool InnerWidget::updateReorderPinned(QPoint localPosition) { const auto delta = [&] { if (localPosition.y() < _visibleTop) { return localPosition.y() - _visibleTop; - } else if (_openedFolder && localPosition.y() > _visibleBottom) { + } else if ((_openedFolder || _filterId) + && localPosition.y() > _visibleBottom) { return localPosition.y() - _visibleBottom; } return 0; diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 419bf6c50..f01a06957 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -745,7 +745,9 @@ void Widget::onDraggingScrollDelta(int delta) { } void Widget::onDraggingScrollTimer() { - auto delta = (_draggingScrollDelta > 0) ? qMin(_draggingScrollDelta * 3 / 20 + 1, int32(Ui::kMaxScrollSpeed)) : qMax(_draggingScrollDelta * 3 / 20 - 1, -int32(Ui::kMaxScrollSpeed)); + const auto delta = (_draggingScrollDelta > 0) + ? qMin(_draggingScrollDelta * 3 / 20 + 1, Ui::kMaxScrollSpeed) + : qMax(_draggingScrollDelta * 3 / 20 - 1, -Ui::kMaxScrollSpeed); _scroll->scrollToY(_scroll->scrollTop() + delta); } From dba5c75ef1b53b82ae22bc8578a20547bf793913 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 13:05:32 +0400 Subject: [PATCH 09/24] Fix adding first proxy to the list. Fixes #7458. --- Telegram/SourceFiles/boxes/connection_box.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index b0912fd9b..68be5de2e 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -691,7 +691,10 @@ void ProxiesBox::applyView(View &&view) { wrap, std::move(view)))); setupButtons(id, i->second.get()); - _noRows.reset(); + if (_noRows) { + _noRows.reset(); + wrap->resizeToWidth(width()); + } } else if (view.host.isEmpty()) { _rows.erase(i); } else { From 90a1cea5159300b8d34aa8f92496075ab5efaa8e Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 13:35:14 +0400 Subject: [PATCH 10/24] Fix forwarded dice size. Fixes #7472. --- Telegram/SourceFiles/history/view/media/history_view_dice.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_dice.cpp b/Telegram/SourceFiles/history/view/media/history_view_dice.cpp index f753d434a..c4ee34d96 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_dice.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_dice.cpp @@ -30,10 +30,9 @@ Dice::Dice(not_null parent, not_null dice) , _dice(dice) , _start(parent, Lookup(parent, 0)) { _showLastFrame = _parent->data()->Has(); + _start.setDiceIndex(0); if (_showLastFrame) { _drawingEnd = true; - } else { - _start.setDiceIndex(0); } } From c209aedb22a1c612f868112e65253aa9160db39c Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 13:47:07 +0400 Subject: [PATCH 11/24] Fix dice animating to the last frame. I hope this fixes #7465. --- .../SourceFiles/history/view/media/history_view_sticker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp b/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp index 2270fe15b..434359764 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp @@ -254,6 +254,10 @@ void Sticker::unloadLottie() { if (!_lottie) { return; } + if (_diceIndex > 0 && _lastDiceFrame.isNull()) { + _nextLastDiceFrame = false; + _lottieOncePlayed = false; + } _lottie = nullptr; _parent->data()->history()->owner().unregisterHeavyViewPart(_parent); } From c89c98183de55b92694910b423f2f370b901b564 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 29 Mar 2020 14:06:10 +0400 Subject: [PATCH 12/24] Handle some updates even while not authed. --- Telegram/SourceFiles/core/application.h | 2 +- Telegram/SourceFiles/intro/intro_widget.cpp | 37 ++++++++++++++++++++- Telegram/SourceFiles/intro/intro_widget.h | 2 ++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/core/application.h b/Telegram/SourceFiles/core/application.h index 3bec6b4ae..f2643fcbe 100644 --- a/Telegram/SourceFiles/core/application.h +++ b/Telegram/SourceFiles/core/application.h @@ -128,7 +128,7 @@ public: void saveSettingsDelayed(crl::time delay = kDefaultSaveDelay); // Dc options and proxy. - MTP::DcOptions *dcOptions() { + not_null dcOptions() { return _dcOptions.get(); } struct ProxyChange { diff --git a/Telegram/SourceFiles/intro/intro_widget.cpp b/Telegram/SourceFiles/intro/intro_widget.cpp index 80ad033a0..87e048d83 100644 --- a/Telegram/SourceFiles/intro/intro_widget.cpp +++ b/Telegram/SourceFiles/intro/intro_widget.cpp @@ -23,9 +23,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/labels.h" #include "ui/wrap/fade_wrap.h" #include "core/update_checker.h" +#include "core/application.h" +#include "mtproto/dc_options.h" #include "window/window_slide_animation.h" #include "window/window_connecting_widget.h" #include "base/platform/base_platform_info.h" +#include "api/api_text_entities.h" #include "facades.h" #include "app.h" #include "styles/style_layers.h" @@ -72,6 +75,11 @@ Widget::Widget(QWidget *parent, not_null account) createLanguageLink(); }); + _account->mtpUpdates( + ) | rpl::start_with_next([=](const MTPUpdates &updates) { + handleUpdates(updates); + }, lifetime()); + _back->entity()->setClickedCallback([=] { historyMove(Direction::Back); }); @@ -116,6 +124,34 @@ void Widget::refreshLang() { InvokeQueued(this, [this] { updateControlsGeometry(); }); } +void Widget::handleUpdates(const MTPUpdates &updates) { + updates.match([&](const MTPDupdateShort &data) { + handleUpdate(data.vupdate()); + }, [&](const MTPDupdates &data) { + for (const auto &update : data.vupdates().v) { + handleUpdate(update); + } + }, [&](const MTPDupdatesCombined &data) { + for (const auto &update : data.vupdates().v) { + handleUpdate(update); + } + }, [](const auto &) {}); +} + +void Widget::handleUpdate(const MTPUpdate &update) { + update.match([&](const MTPDupdateDcOptions &data) { + Core::App().dcOptions()->addFromList(data.vdc_options()); + }, [&](const MTPDupdateConfig &data) { + _account->mtp()->requestConfig(); + }, [&](const MTPDupdateServiceNotification &data) { + const auto text = TextWithEntities{ + qs(data.vmessage()), + Api::EntitiesFromMTP(data.ventities().v) + }; + Ui::show(Box(text)); + }, [](const auto &) {}); +} + void Widget::createLanguageLink() { if (_changeLanguage) { return; @@ -651,7 +687,6 @@ void Widget::updateControlsGeometry() { } } - void Widget::keyPressEvent(QKeyEvent *e) { if (_a_show.animating() || getStep()->animating()) return; diff --git a/Telegram/SourceFiles/intro/intro_widget.h b/Telegram/SourceFiles/intro/intro_widget.h index b26e1f452..978bfc812 100644 --- a/Telegram/SourceFiles/intro/intro_widget.h +++ b/Telegram/SourceFiles/intro/intro_widget.h @@ -93,6 +93,8 @@ private: void createLanguageLink(); void checkUpdateStatus(); void setupNextButton(); + void handleUpdates(const MTPUpdates &updates); + void handleUpdate(const MTPUpdate &update); void updateControlsGeometry(); [[nodiscard]] not_null getData() { From bdde198f52113069eb5260734658f7621387c5ab Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 28 Mar 2020 07:23:19 +0400 Subject: [PATCH 13/24] Add AV1 support to snap --- .github/workflows/snap.yml | 10 +++++----- snap/snapcraft.yaml | 28 +++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml index 0b504c329..508a4b4df 100644 --- a/.github/workflows/snap.yml +++ b/.github/workflows/snap.yml @@ -67,7 +67,7 @@ jobs: - name: CMake build. if: steps.cache-cmake.outputs.cache-hit != 'true' - run: snapcraft build --destructive-mode cmake + run: sudo snapcraft build --destructive-mode cmake - name: FFmpeg cache. id: cache-ffmpeg @@ -78,11 +78,11 @@ jobs: - name: FFmpeg build. if: steps.cache-ffmpeg.outputs.cache-hit != 'true' - run: snapcraft build --destructive-mode ffmpeg + run: sudo snapcraft build --destructive-mode ffmpeg - name: Telegram Desktop snap build. if: env.ONLY_CACHE == 'false' - run: snapcraft --destructive-mode + run: sudo snapcraft --destructive-mode - name: Move artifact. if: env.UPLOAD_ARTIFACT == 'true' @@ -102,5 +102,5 @@ jobs: - name: Remove unneeded directories for cache. run: | - rm -rf parts/{cmake,ffmpeg}/{build,src,ubuntu} - rm -rf parts/{cmake,ffmpeg}/state/{stage,prime} + sudo rm -rf parts/{cmake,ffmpeg}/{build,src,ubuntu} + sudo rm -rf parts/{cmake,ffmpeg}/state/{stage,prime} diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index dddf80925..a1294231c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -191,13 +191,35 @@ parts: - libtinfo5 prime: [-./*] + nasm: + source: https://repo.or.cz/nasm.git + source-depth: 1 + source-tag: nasm-2.14.02 + plugin: autotools + override-build: | + ./autogen.sh + ./configure --prefix= + make + install -d "$SNAPCRAFT_PART_INSTALL/bin" + install nasm "$SNAPCRAFT_PART_INSTALL/bin/nasm" + install ndisasm "$SNAPCRAFT_PART_INSTALL/bin/ndisasm" + prime: [-./*] + + dav1d: + source: https://github.com/videolan/dav1d.git + source-depth: 1 + source-tag: 0.6.0 + plugin: meson + meson-parameters: [--prefix=/usr] + after: + - nasm + ffmpeg: source: https://github.com/FFmpeg/FFmpeg.git source-depth: 1 source-branch: release/4.2 plugin: autotools build-packages: - - yasm - libasound2-dev - libopus-dev - libva-dev @@ -219,6 +241,7 @@ parts: - --disable-iconv - --enable-gpl - --enable-version3 + - --enable-libdav1d - --enable-libopus - --enable-vaapi - --enable-vdpau @@ -228,6 +251,7 @@ parts: - --enable-decoder=flac - --enable-decoder=gif - --enable-decoder=h264 + - --enable-decoder=libdav1d - --enable-decoder=mp1 - --enable-decoder=mp1float - --enable-decoder=mp2 @@ -277,6 +301,8 @@ parts: patch -p1 < "$SNAPCRAFT_STAGE/ffmpeg.diff" after: - patches + - nasm + - dav1d openal: source: https://github.com/kcat/openal-soft.git From aa4968faaa98ed5e72d8c6bee8316a0ee2ff300a Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 28 Mar 2020 11:18:33 +0400 Subject: [PATCH 14/24] Re-use fontconfig fallback code in snap --- Telegram/SourceFiles/platform/linux/specific_linux.cpp | 4 ++-- Telegram/cmake/telegram_options.cmake | 5 +++++ snap/snapcraft.yaml | 7 +------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 9e77745bf..33304fe00 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -96,7 +96,7 @@ bool RunShellCommand(const QByteArray &command) { } void FallbackFontConfig() { -#ifdef TDESKTOP_USE_FONT_CONFIG_FALLBACK +#ifdef TDESKTOP_USE_FONTCONFIG_FALLBACK const auto custom = cWorkingDir() + "tdata/fc-custom-1.conf"; const auto finish = gsl::finally([&] { if (QFile(custom).exists()) { @@ -131,7 +131,7 @@ void FallbackFontConfig() { } QFile(":/fc/fc-custom.conf").copy(custom); -#endif // TDESKTOP_USE_FONT_CONFIG_FALLBACK +#endif // TDESKTOP_USE_FONTCONFIG_FALLBACK } bool GenerateDesktopFile( diff --git a/Telegram/cmake/telegram_options.cmake b/Telegram/cmake/telegram_options.cmake index 50b57c9c1..442ed596a 100644 --- a/Telegram/cmake/telegram_options.cmake +++ b/Telegram/cmake/telegram_options.cmake @@ -4,6 +4,7 @@ # For license and copyright information please follow this link: # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +option(TDESKTOP_USE_FONTCONFIG_FALLBACK "Use custom fonts.conf (Linux only)." OFF) option(TDESKTOP_FORCE_GTK_FILE_DIALOG "Force using GTK file dialog (Linux only)." OFF) option(TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME "Disable automatic 'tg://' URL scheme handler registration." ${DESKTOP_APP_USE_PACKAGED}) option(TDESKTOP_DISABLE_NETWORK_PROXY "Disable all code for working through Socks5 or MTProxy." OFF) @@ -63,6 +64,10 @@ if (DESKTOP_APP_SPECIAL_TARGET) target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA) endif() +if (TDESKTOP_USE_FONTCONFIG_FALLBACK) + target_compile_definitions(Telegram PRIVATE TDESKTOP_USE_FONTCONFIG_FALLBACK) +endif() + if (TDESKTOP_FORCE_GTK_FILE_DIALOG) target_compile_definitions(Telegram PRIVATE TDESKTOP_FORCE_GTK_FILE_DIALOG) endif() diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a1294231c..fcaf9e9cc 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -102,6 +102,7 @@ parts: - -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF - -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF - -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF + - -DTDESKTOP_USE_FONTCONFIG_FALLBACK=ON override-pull: | snapcraftctl pull @@ -118,10 +119,6 @@ parts: snapcraftctl set-version "$version" sed -i 's|^Icon=.*|Icon=/share/icons/hicolor/512x512/apps/telegram.png|g' lib/xdg/telegramdesktop.desktop - override-build: | - snapcraftctl build - mkdir -p "$SNAPCRAFT_PART_INSTALL/etc/fonts" - cp "$SNAPCRAFT_PART_SRC/Telegram/lib_ui/qt_conf/fc-custom.conf" "$SNAPCRAFT_PART_INSTALL/etc/fonts/fonts.conf" after: - cmake - desktop-qt5 @@ -159,13 +156,11 @@ parts: - locales-all - xdg-user-dirs - fcitx-frontend-qt5 - stage: [-etc/fonts/fonts.conf] qt5-gtk-platform: plugin: nil stage-packages: - qt5-gtk-platformtheme - stage: [-etc/fonts/fonts.conf] cmake: source: "https://gitlab.kitware.com/cmake/cmake.git" From 86b9927965fb08ace10c3b937fecd808722441ff Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 28 Mar 2020 07:34:13 +0400 Subject: [PATCH 15/24] Log global menu usage --- .../platform/linux/main_window_linux.cpp | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 7b2e5d9ef..24e3fe701 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -291,6 +291,14 @@ std::unique_ptr TrayIconFile( return ret; } + +bool UseUnityCounter() { + static const auto UnityCounter = QDBusInterface( + "com.canonical.Unity", + "/").isValid(); + + return UnityCounter; +} #endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION bool IsSNIAvailable() { @@ -319,18 +327,6 @@ bool IsSNIAvailable() { return false; } -bool UseUnityCounter() { -#ifdef TDESKTOP_DISABLE_DBUS_INTEGRATION - static const auto UnityCounter = false; -#else // TDESKTOP_DISABLE_DBUS_INTEGRATION - static const auto UnityCounter = QDBusInterface( - "com.canonical.Unity", - "/").isValid(); -#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION - - return UnityCounter; -} - quint32 djbStringHash(QString string) { quint32 hash = 5381; QByteArray chars = string.toLatin1(); @@ -438,13 +434,19 @@ void MainWindow::initHook() { &QWindow::visibleChanged, this, &MainWindow::onVisibleChanged); -#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION + + if (AppMenuSupported()) { + LOG(("Using D-Bus global menu.")); + } else { + LOG(("Not using D-Bus global menu.")); + } if (UseUnityCounter()) { LOG(("Using Unity launcher counter.")); } else { LOG(("Not using Unity launcher counter.")); } +#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION } bool MainWindow::hasTrayIcon() const { From 0d58f1c9fa5be2934ae59c71b62e4a261d914b30 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 12:18:50 +0400 Subject: [PATCH 16/24] Try system font config once in snap build. --- Telegram/SourceFiles/core/ui_integration.cpp | 8 +++ Telegram/SourceFiles/core/ui_integration.h | 3 + .../platform/linux/specific_linux.cpp | 72 ++++++++++++++----- .../platform/linux/specific_linux.h | 3 + .../SourceFiles/platform/mac/specific_mac.h | 6 ++ .../SourceFiles/platform/win/specific_win.h | 6 ++ Telegram/lib_ui | 2 +- 7 files changed, 80 insertions(+), 20 deletions(-) diff --git a/Telegram/SourceFiles/core/ui_integration.cpp b/Telegram/SourceFiles/core/ui_integration.cpp index ccc76aa66..9e4161b17 100644 --- a/Telegram/SourceFiles/core/ui_integration.cpp +++ b/Telegram/SourceFiles/core/ui_integration.cpp @@ -52,6 +52,14 @@ void UiIntegration::activationFromTopPanel() { Platform::IgnoreApplicationActivationRightNow(); } +void UiIntegration::startFontsBegin() { + Platform::FallbackFontConfigCheckBegin(); +} + +void UiIntegration::startFontsEnd() { + Platform::FallbackFontConfigCheckEnd(); +} + std::shared_ptr UiIntegration::createLinkHandler( EntityType type, const QString &text, diff --git a/Telegram/SourceFiles/core/ui_integration.h b/Telegram/SourceFiles/core/ui_integration.h index b53c76aa7..3cb3e191c 100644 --- a/Telegram/SourceFiles/core/ui_integration.h +++ b/Telegram/SourceFiles/core/ui_integration.h @@ -23,6 +23,9 @@ public: void textActionsUpdated() override; void activationFromTopPanel() override; + void startFontsBegin() override; + void startFontsEnd() override; + std::shared_ptr createLinkHandler( EntityType type, const QString &text, diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 33304fe00..49e07bff7 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -44,6 +44,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL using namespace Platform; using Platform::File::internal::EscapeShell; +namespace Platform { namespace { constexpr auto kDesktopFile = ":/misc/telegramdesktop.desktop"_cs; @@ -95,23 +96,27 @@ bool RunShellCommand(const QByteArray &command) { return true; } -void FallbackFontConfig() { -#ifdef TDESKTOP_USE_FONTCONFIG_FALLBACK - const auto custom = cWorkingDir() + "tdata/fc-custom-1.conf"; - const auto finish = gsl::finally([&] { - if (QFile(custom).exists()) { - LOG(("Custom FONTCONFIG_FILE: ") + custom); - qputenv("FONTCONFIG_FILE", QFile::encodeName(custom)); - } - }); +[[nodiscard]] bool CheckFontConfigCrash() { + return InSnap(); +} +[[nodiscard]] QString FallbackFontConfigCheckPath() { + return cWorkingDir() + "tdata/fc-check"; +} + +#ifdef TDESKTOP_USE_FONTCONFIG_FALLBACK + +[[nodiscard]] bool BadFontConfigVersion() { + if (CheckFontConfigCrash()) { + return QFile(FallbackFontConfigCheckPath()).exists(); + } QProcess process; process.setProcessChannelMode(QProcess::MergedChannels); process.start("fc-list", QStringList() << "--version"); process.waitForFinished(); if (process.exitCode() > 0) { LOG(("App Error: Could not start fc-list. Process exited with code: %1.").arg(process.exitCode())); - return; + return false; } QString result(process.readAllStandardOutput()); @@ -120,20 +125,31 @@ void FallbackFontConfig() { QVersionNumber version = QVersionNumber::fromString(result.split("version ").last()); if (version.isNull()) { LOG(("App Error: Could not get version from fc-list output.")); - return; + return false; } LOG(("Fontconfig version: %1.").arg(version.toString())); if (version < QVersionNumber::fromString("2.13")) { if (qgetenv("TDESKTOP_FORCE_CUSTOM_FONTCONFIG").isEmpty()) { - return; + return false; } } - - QFile(":/fc/fc-custom.conf").copy(custom); -#endif // TDESKTOP_USE_FONTCONFIG_FALLBACK + return true; } +void FallbackFontConfig() { + if (BadFontConfigVersion()) { + const auto custom = cWorkingDir() + "tdata/fc-custom-1.conf"; + QFile(":/fc/fc-custom.conf").copy(custom); + if (QFile(custom).exists()) { + LOG(("Custom FONTCONFIG_FILE: ") + custom); + qputenv("FONTCONFIG_FILE", QFile::encodeName(custom)); + } + } +} + +#endif // TDESKTOP_USE_FONTCONFIG_FALLBACK + bool GenerateDesktopFile( const QString &targetPath, const QString &args, @@ -208,8 +224,6 @@ bool GenerateDesktopFile( } // namespace -namespace Platform { - void SetApplicationIcon(const QIcon &icon) { QApplication::setWindowIcon(icon); } @@ -405,6 +419,23 @@ std::optional LastUserInputTime() { return std::nullopt; } +void FallbackFontConfigCheckBegin() { + if (!CheckFontConfigCrash()) { + return; + } + auto file = QFile(FallbackFontConfigCheckPath()); + if (file.open(QIODevice::WriteOnly)) { + file.write("1", 1); + } +} + +void FallbackFontConfigCheckEnd() { + if (!CheckFontConfigCrash()) { + return; + } + QFile(FallbackFontConfigCheckPath()).remove(); +} + } // namespace Platform namespace { @@ -521,7 +552,10 @@ namespace Platform { void start() { LOG(("Launcher filename: %1").arg(GetLauncherFilename())); + +#ifdef TDESKTOP_USE_FONTCONFIG_FALLBACK FallbackFontConfig(); +#endif // TDESKTOP_USE_FONTCONFIG_FALLBACK qputenv("PULSE_PROP_application.name", AppName.utf8()); qputenv("PULSE_PROP_application.icon_name", GetIconName().toLatin1()); @@ -529,9 +563,9 @@ void start() { #ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG LOG(("Checking for XDG Desktop Portal...")); // this can give us a chance to use a proper file dialog for current session - if(IsXDGDesktopPortalPresent()) { + if (IsXDGDesktopPortalPresent()) { LOG(("XDG Desktop Portal is present!")); - if(UseXDGDesktopPortal()) { + if (UseXDGDesktopPortal()) { LOG(("Usage of XDG Desktop Portal is enabled.")); qputenv("QT_QPA_PLATFORMTHEME", "xdgdesktopportal"); } else { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.h b/Telegram/SourceFiles/platform/linux/specific_linux.h index 7f18032cb..28e3ef386 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.h +++ b/Telegram/SourceFiles/platform/linux/specific_linux.h @@ -40,6 +40,9 @@ QString GetIconName(); inline void IgnoreApplicationActivationRightNow() { } +void FallbackFontConfigCheckBegin(); +void FallbackFontConfigCheckEnd(); + } // namespace Platform inline void psCheckLocalSocket(const QString &serverName) { diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.h b/Telegram/SourceFiles/platform/mac/specific_mac.h index 0d4c4896f..09de68ff9 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.h +++ b/Telegram/SourceFiles/platform/mac/specific_mac.h @@ -22,6 +22,12 @@ QString SingleInstanceLocalServerName(const QString &hash); void RemoveQuarantine(const QString &path); +inline void FallbackFontConfigCheckBegin() { +} + +inline void FallbackFontConfigCheckEnd() { +} + namespace ThirdParty { inline void start() { diff --git a/Telegram/SourceFiles/platform/win/specific_win.h b/Telegram/SourceFiles/platform/win/specific_win.h index 330cae4b7..17092a1c4 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.h +++ b/Telegram/SourceFiles/platform/win/specific_win.h @@ -26,6 +26,12 @@ QString SingleInstanceLocalServerName(const QString &hash); inline void IgnoreApplicationActivationRightNow() { } +inline void FallbackFontConfigCheckBegin() { +} + +inline void FallbackFontConfigCheckEnd() { +} + namespace ThirdParty { void start(); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 23009b62a..246aa2453 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 23009b62add39f22cca27438a17f83762d8c2f94 +Subproject commit 246aa24530ccc5a5ab06053109a030ceccdb9139 From 49111814e439b2e57733f463982455674c670be9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 13:46:06 +0400 Subject: [PATCH 17/24] Add fallback codepath for QSaveFile::open failure. --- Telegram/SourceFiles/storage/localstorage.cpp | 244 +++++++++++------- Telegram/lib_base | 2 +- 2 files changed, 152 insertions(+), 94 deletions(-) diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index 5d4d1b71b..0e529850c 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -15,6 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_drafts.h" #include "data/data_user.h" #include "boxes/send_files_box.h" +#include "base/flags.h" +#include "base/platform/base_platform_file_utilities.h" #include "base/platform/base_platform_info.h" #include "ui/widgets/input_fields.h" #include "ui/emoji_config.h" @@ -35,7 +37,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "main/main_session.h" #include "window/themes/window_theme.h" #include "window/window_session_controller.h" -#include "base/flags.h" #include "data/data_session.h" #include "history/history.h" #include "facades.h" @@ -251,97 +252,24 @@ struct EncryptedDescriptor { }; struct FileWriteDescriptor { - FileWriteDescriptor(const FileKey &key, FileOptions options = FileOption::User | FileOption::Safe) - : file((options & FileOption::Safe) ? (QFileDevice&)saveFile : plainFile) { - init(toFilePart(key), options); - } - FileWriteDescriptor(const QString &name, FileOptions options = FileOption::User | FileOption::Safe) - : file((options & FileOption::Safe) ? (QFileDevice&)saveFile : plainFile) { - init(name, options); - } - void init(const QString &name, FileOptions options) { - if (options & FileOption::User) { - if (!_userWorking()) return; - } else { - if (!_working()) return; - } + FileWriteDescriptor( + const FileKey &key, + FileOptions options = FileOption::User | FileOption::Safe); + FileWriteDescriptor( + const QString &name, + FileOptions options = FileOption::User | FileOption::Safe); + ~FileWriteDescriptor(); - const auto base = ((options & FileOption::User) ? _userBasePath : _basePath) + name; - if (options & FileOption::Safe) { - toDelete = base; - saveFile.setFileName(base + 's'); - } else { - plainFile.setFileName(base + '0'); - } - if (file.open(QIODevice::WriteOnly)) { - file.write(tdfMagic, tdfMagicLen); - qint32 version = AppVersion; - file.write((const char*)&version, sizeof(version)); + void init(const QString &name, FileOptions options); + bool writeData(const QByteArray &data); + bool writeEncrypted( + EncryptedDescriptor &data, + const MTP::AuthKeyPtr &key = LocalKey); + void finish(); - stream.setDevice(&file); - stream.setVersion(QDataStream::Qt_5_1); - } - } - bool writeData(const QByteArray &data) { - if (!file.isOpen()) return false; - - stream << data; - quint32 len = data.isNull() ? 0xffffffff : data.size(); - if (QSysInfo::ByteOrder != QSysInfo::BigEndian) { - len = qbswap(len); - } - md5.feed(&len, sizeof(len)); - md5.feed(data.constData(), data.size()); - dataSize += sizeof(len) + data.size(); - - return true; - } - static QByteArray prepareEncrypted(EncryptedDescriptor &data, const MTP::AuthKeyPtr &key = LocalKey) { - data.finish(); - QByteArray &toEncrypt(data.data); - - // prepare for encryption - uint32 size = toEncrypt.size(), fullSize = size; - if (fullSize & 0x0F) { - fullSize += 0x10 - (fullSize & 0x0F); - toEncrypt.resize(fullSize); - memset_rand(toEncrypt.data() + size, fullSize - size); - } - *(uint32*)toEncrypt.data() = size; - QByteArray encrypted(0x10 + fullSize, Qt::Uninitialized); // 128bit of sha1 - key128, sizeof(data), data - hashSha1(toEncrypt.constData(), toEncrypt.size(), encrypted.data()); - MTP::aesEncryptLocal(toEncrypt.constData(), encrypted.data() + 0x10, fullSize, key, encrypted.constData()); - - return encrypted; - } - bool writeEncrypted(EncryptedDescriptor &data, const MTP::AuthKeyPtr &key = LocalKey) { - return writeData(prepareEncrypted(data, key)); - } - void finish() { - if (!file.isOpen()) return; - - stream.setDevice(nullptr); - - md5.feed(&dataSize, sizeof(dataSize)); - qint32 version = AppVersion; - md5.feed(&version, sizeof(version)); - md5.feed(tdfMagic, tdfMagicLen); - file.write((const char*)md5.result(), 0x10); - - if (saveFile.isOpen()) { - saveFile.commit(); - } else { - plainFile.close(); - } - - if (!toDelete.isEmpty()) { - QFile::remove(toDelete + '0'); - QFile::remove(toDelete + '1'); - } - } QFile plainFile; QSaveFile saveFile; - QFileDevice &file; + not_null file; QDataStream stream; QString toDelete; @@ -349,11 +277,141 @@ struct FileWriteDescriptor { HashMd5 md5; int32 dataSize = 0; - ~FileWriteDescriptor() { - finish(); - } }; +[[nodiscard]] QByteArray PrepareEncrypted( + EncryptedDescriptor &data, + const MTP::AuthKeyPtr &key = LocalKey) { + data.finish(); + QByteArray &toEncrypt(data.data); + + // prepare for encryption + uint32 size = toEncrypt.size(), fullSize = size; + if (fullSize & 0x0F) { + fullSize += 0x10 - (fullSize & 0x0F); + toEncrypt.resize(fullSize); + memset_rand(toEncrypt.data() + size, fullSize - size); + } + *(uint32*)toEncrypt.data() = size; + QByteArray encrypted(0x10 + fullSize, Qt::Uninitialized); // 128bit of sha1 - key128, sizeof(data), data + hashSha1(toEncrypt.constData(), toEncrypt.size(), encrypted.data()); + MTP::aesEncryptLocal(toEncrypt.constData(), encrypted.data() + 0x10, fullSize, key, encrypted.constData()); + + return encrypted; +} + +FileWriteDescriptor::FileWriteDescriptor( + const FileKey &key, + FileOptions options) +: file((options & FileOption::Safe) ? (QFileDevice*)&saveFile : &plainFile) { + init(toFilePart(key), options); +} + +FileWriteDescriptor::FileWriteDescriptor( + const QString &name, + FileOptions options) +: file((options & FileOption::Safe) ? (QFileDevice*)&saveFile : &plainFile) { + init(name, options); +} + +FileWriteDescriptor::~FileWriteDescriptor() { + finish(); +} + +void FileWriteDescriptor::init(const QString &name, FileOptions options) { + if (options & FileOption::User) { + if (!_userWorking()) return; + } else { + if (!_working()) return; + } + + const auto base = ((options & FileOption::User) ? _userBasePath : _basePath) + name; + saveFile.setFileName(base + 's'); + plainFile.setFileName(base + '0'); + if (options & FileOption::Safe) { + toDelete = base; + } + if (!file->open(QIODevice::WriteOnly)) { + LOG(("Storage Error: Could not open '%1' for writing.").arg(file->fileName())); + if (!(options & FileOption::Safe)) { + return; + } + file = &plainFile; + LOG(("Storage Info: Trying to fallback to '%1'.").arg(file->fileName())); + if (!file->open(QIODevice::WriteOnly)) { + LOG(("Storage Error: Could not open '%1' for safe writing.").arg(file->fileName())); + return; + } + } + file->write(tdfMagic, tdfMagicLen); + qint32 version = AppVersion; + file->write((const char*)&version, sizeof(version)); + + stream.setDevice(file); + stream.setVersion(QDataStream::Qt_5_1); +} + +bool FileWriteDescriptor::writeData(const QByteArray &data) { + if (!file->isOpen()) { + return false; + } + + stream << data; + quint32 len = data.isNull() ? 0xffffffff : data.size(); + if (QSysInfo::ByteOrder != QSysInfo::BigEndian) { + len = qbswap(len); + } + md5.feed(&len, sizeof(len)); + md5.feed(data.constData(), data.size()); + dataSize += sizeof(len) + data.size(); + + return true; +} + +bool FileWriteDescriptor::writeEncrypted( + EncryptedDescriptor &data, + const MTP::AuthKeyPtr &key) { + return writeData(PrepareEncrypted(data, key)); +} + +void FileWriteDescriptor::finish() { + if (!file->isOpen()) { + return; + } + + stream.setDevice(nullptr); + + md5.feed(&dataSize, sizeof(dataSize)); + qint32 version = AppVersion; + md5.feed(&version, sizeof(version)); + md5.feed(tdfMagic, tdfMagicLen); + file->write((const char*)md5.result(), 0x10); + + if (saveFile.isOpen()) { + if (!saveFile.commit()) { + LOG(("Storage Error: Could not commit safe writing in '%1'." + ).arg(saveFile.fileName())); + } + } else { + plainFile.close(); + if (!toDelete.isEmpty()) { + QFile::remove(toDelete + '1'); + if (!base::Platform::RenameWithOverwrite( + plainFile.fileName(), + saveFile.fileName())) { + LOG(("Storage Error: Could not rename '%1' to '%2'" + ).arg(plainFile.fileName() + ).arg(saveFile.fileName())); + } + } + } + + if (!toDelete.isEmpty()) { + QFile::remove(toDelete + '0'); + QFile::remove(toDelete + '1'); + } +} + bool readFile(FileReadDescriptor &result, const QString &name, FileOptions options = FileOption::User | FileOption::Safe) { if (options & FileOption::User) { if (!_userWorking()) return false; @@ -2482,7 +2540,7 @@ void _writeMap(WriteMapWhen when) { EncryptedDescriptor passKeyData(kLocalKeySize); LocalKey->write(passKeyData.stream); - _passKeyEncrypted = FileWriteDescriptor::prepareEncrypted(passKeyData, PassKey); + _passKeyEncrypted = PrepareEncrypted(passKeyData, PassKey); } map.writeData(_passKeySalt); map.writeData(_passKeyEncrypted); @@ -2868,7 +2926,7 @@ void setPasscode(const QByteArray &passcode) { EncryptedDescriptor passKeyData(kLocalKeySize); LocalKey->write(passKeyData.stream); - _passKeyEncrypted = FileWriteDescriptor::prepareEncrypted(passKeyData, PassKey); + _passKeyEncrypted = PrepareEncrypted(passKeyData, PassKey); _mapChanged = true; _writeMap(WriteMapWhen::Now); diff --git a/Telegram/lib_base b/Telegram/lib_base index 7de25679d..05b4e4e2a 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 7de25679dd68f3fb7d2faee77ff5311f4d9587d6 +Subproject commit 05b4e4e2a813b2888858acde80f67c4eafffdbce From 2feaa85ed943b45647d0a04374879cd19df0af2b Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 13:51:02 +0400 Subject: [PATCH 18/24] Fix fontconfig fallback for snap. --- Telegram/lib_ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 246aa2453..86cb882aa 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 246aa24530ccc5a5ab06053109a030ceccdb9139 +Subproject commit 86cb882aab071c2a7933fcfc8d0834e38dca3651 From 570ab663b7f5b974438a7d6f5fbeb07b91339043 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 14:57:14 +0400 Subject: [PATCH 19/24] Use cache for remembered last dice frames. --- .../history/view/media/history_view_sticker.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp b/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp index 434359764..800de02f7 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp @@ -31,12 +31,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace HistoryView { namespace { -double GetEmojiStickerZoom(not_null session) { +[[nodiscard]] double GetEmojiStickerZoom(not_null session) { return session->account().appConfig().get( "emojies_animated_zoom", 0.625); } +[[nodiscard]] QImage CacheDiceImage(int index, const QImage &image) { + static auto Cache = base::flat_map(); + const auto i = Cache.find(index); + if (i != end(Cache) && i->second.size() == image.size()) { + return i->second; + } + Cache[index] = image; + return image; +} + } // namespace Sticker::Sticker( @@ -116,7 +126,7 @@ void Sticker::paintLottie(Painter &p, const QRect &r, bool selected) { : Lottie::Animation::FrameInfo(); if (_nextLastDiceFrame) { _nextLastDiceFrame = false; - _lastDiceFrame = frame.image; + _lastDiceFrame = CacheDiceImage(_diceIndex, frame.image); } const auto &image = _lastDiceFrame.isNull() ? frame.image From 2379812890b5e7f08c37b80375de6951de23061e Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 15:00:50 +0400 Subject: [PATCH 20/24] Move add exceptions button to the top. --- .../boxes/filters/edit_filter_box.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp index e58893c69..db935d7cc 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp @@ -545,6 +545,11 @@ void EditFilterBox( AddSkip(content); AddSubsectionTitle(content, tr::lng_filters_include()); + const auto includeAdd = AddButton( + content, + tr::lng_filters_add_chats() | Ui::Text::ToUpper(), + st::settingsUpdate); + const auto include = SetupChatsPreview( content, data, @@ -552,11 +557,6 @@ void EditFilterBox( kTypes, &Data::ChatFilter::always); - const auto includeAdd = AddButton( - content, - tr::lng_filters_add_chats() | Ui::Text::ToUpper(), - st::settingsUpdate); - AddSkip(content); content->add( object_ptr( @@ -569,6 +569,11 @@ void EditFilterBox( AddSubsectionTitle(content, tr::lng_filters_exclude()); + const auto excludeAdd = AddButton( + content, + tr::lng_filters_remove_chats() | Ui::Text::ToUpper(), + st::settingsUpdate); + const auto exclude = SetupChatsPreview( content, data, @@ -576,11 +581,6 @@ void EditFilterBox( kExcludeTypes, &Data::ChatFilter::never); - const auto excludeAdd = AddButton( - content, - tr::lng_filters_remove_chats() | Ui::Text::ToUpper(), - st::settingsUpdate); - AddSkip(content); content->add( object_ptr( From 7b44d107c9d7cd134aba4b20c4846e663dbf6110 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 15:10:08 +0400 Subject: [PATCH 21/24] Don't use default title if it doesn't fit. --- Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp index db935d7cc..d0cea28d9 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp @@ -468,6 +468,10 @@ void CreateIconSelector( return QString(); } +[[nodiscard]] QString TrimDefaultTitle(const QString &title) { + return (title.size() <= kMaxFilterTitleLength) ? title : QString(); +} + } // namespace void EditFilterBox( @@ -511,7 +515,7 @@ void EditFilterBox( if (nameEditing->custom) { return; } - const auto title = DefaultTitle(filter); + const auto title = TrimDefaultTitle(DefaultTitle(filter)); if (nameEditing->field->getLastText() != title) { nameEditing->settingDefault = true; nameEditing->field->setText(title); From 31ba2828af957fea804906d2e6ec50f5830a5d21 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 15:21:16 +0400 Subject: [PATCH 22/24] Add a tooltip with information about the dice. --- Telegram/Resources/langs/lang.strings | 2 ++ .../history/view/media/history_view_dice.cpp | 16 ++++++++++++++++ .../history/view/media/history_view_dice.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 6c99f6878..2ef997bdf 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1329,6 +1329,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_dialogs_skip_archive_in_search" = "Skip results from archive"; "lng_dialogs_show_archive_in_search" = "With results from archive"; +"lng_about_dice" = "Send a 🎲 emoji to any chat to get a random number from Telegram."; + "lng_open_this_link" = "Open this link?"; "lng_open_link" = "Open"; "lng_allow_bot_pass" = "Allow {bot_name} to pass your Telegram name and ID to the web pages you open via this bot?"; diff --git a/Telegram/SourceFiles/history/view/media/history_view_dice.cpp b/Telegram/SourceFiles/history/view/media/history_view_dice.cpp index c4ee34d96..587b0e929 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_dice.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_dice.cpp @@ -13,6 +13,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_item.h" #include "history/history_item_components.h" #include "history/view/history_view_element.h" +#include "ui/toast/toast.h" +#include "lang/lang_keys.h" #include "main/main_session.h" namespace HistoryView { @@ -42,6 +44,20 @@ QSize Dice::size() { return _start.size(); } +ClickHandlerPtr Dice::link() { + if (_parent->data()->Has()) { + return nullptr; + } + static auto kHandler = std::make_shared([] { + auto config = Ui::Toast::Config(); + config.multiline = true; + config.minWidth = st::msgMinWidth; + config.text = tr::lng_about_dice(tr::now); + Ui::Toast::Show(config); + }); + return kHandler; +} + void Dice::draw(Painter &p, const QRect &r, bool selected) { if (const auto value = _end ? 0 : _dice->diceValue()) { if (const auto document = Lookup(_parent, value)) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_dice.h b/Telegram/SourceFiles/history/view/media/history_view_dice.h index d8967412f..113c94dba 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_dice.h +++ b/Telegram/SourceFiles/history/view/media/history_view_dice.h @@ -24,6 +24,8 @@ public: QSize size() override; void draw(Painter &p, const QRect &r, bool selected) override; + ClickHandlerPtr link() override; + void clearStickerLoopPlayed() override { } void unloadHeavyPart() override { From 8c6b5caa579abc5f3d94cd4121a8b2feb034b46c Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 16:43:09 +0400 Subject: [PATCH 23/24] Fix possible crash in inconsistent HistoryWidget state. --- Telegram/SourceFiles/history/history_widget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 1905627b8..6166a5854 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1769,6 +1769,7 @@ void HistoryWidget::showHistory( _showAtMsgId = showAtMsgId; _historyInited = false; + _contactStatus = nullptr; // Unload lottie animations. Auth().data().unloadHeavyViewParts(HistoryInner::ElementDelegate()); @@ -1786,8 +1787,6 @@ void HistoryWidget::showHistory( }, _contactStatus->lifetime()); orderWidgets(); controller()->tabbedSelector()->setCurrentPeer(_peer); - } else { - _contactStatus = nullptr; } refreshTabbedPanel(); From f4822cf55894825b64dbdc4809ee49e0a5160c32 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Mar 2020 16:56:15 +0400 Subject: [PATCH 24/24] Version 2.0. - Organize chats into Chat Folders if you have too many chats. - Create custom folders with flexible settings, or use default recommendations. - Pin an unlimited number of chats in each folder. - Switch between folders in the new side bar to easily access all of your chats. - Send :dice: to any chat to try your luck and get a random number from the animated dice. - Send :virus:, :face_with_thermometer:, :mask:, :face_with_head_bandage:, :sneeze:, :sick:, :soap: or :ambulance: to try out the new animated emoji. --- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/core/version.h | 6 +++--- Telegram/build/version | 12 ++++++------ changelog.txt | 9 +++++++++ cmake | 2 +- 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index 5db8923b4..9feaa42a4 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="2.0.0.0" /> Telegram Desktop Telegram FZ-LLC diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 9d7cda51b..3b4fe93d0 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,9,22,0 - PRODUCTVERSION 1,9,22,0 + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,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.9.22.0" + VALUE "FileVersion", "2.0.0.0" VALUE "LegalCopyright", "Copyright (C) 2014-2020" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.9.22.0" + VALUE "ProductVersion", "2.0.0.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index 2c0f6c43c..aac9a90f2 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,9,22,0 - PRODUCTVERSION 1,9,22,0 + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,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.9.22.0" + VALUE "FileVersion", "2.0.0.0" VALUE "LegalCopyright", "Copyright (C) 2014-2020" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.9.22.0" + VALUE "ProductVersion", "2.0.0.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 455f6c8b7..ad8bc511f 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,7 +22,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 = 1009022; -constexpr auto AppVersionStr = "1.9.22"; -constexpr auto AppBetaVersion = true; +constexpr auto AppVersion = 2000000; +constexpr auto AppVersionStr = "2.0"; +constexpr auto AppBetaVersion = false; constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION; diff --git a/Telegram/build/version b/Telegram/build/version index a1f24723d..b6e9151e0 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,7 +1,7 @@ -AppVersion 1009022 -AppVersionStrMajor 1.9 -AppVersionStrSmall 1.9.22 -AppVersionStr 1.9.22 -BetaChannel 1 +AppVersion 2000000 +AppVersionStrMajor 2.0 +AppVersionStrSmall 2.0 +AppVersionStr 2.0.0 +BetaChannel 0 AlphaVersion 0 -AppVersionOriginal 1.9.22.beta +AppVersionOriginal 2.0 diff --git a/changelog.txt b/changelog.txt index 258870949..5d85a0ba8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +2.0 (30.03.20) + +- Organize chats into Chat Folders if you have too many chats. +- Create custom folders with flexible settings, or use default recommendations. +- Pin an unlimited number of chats in each folder. +- Switch between folders in the new side bar to easily access all of your chats. +- Send :dice: to any chat to try your luck and get a random number from the animated dice. +- Send :virus:, :face_with_thermometer:, :mask:, :face_with_head_bandage:, :sneeze:, :sick:, :soap: or :ambulance: to try out the new animated emoji. + 1.9.22 beta (27.03.20) - Organize chats into Chat Folders if you have too many chats. diff --git a/cmake b/cmake index d48723593..b4ea62dfd 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit d48723593fa05c57814c74221e6b39c4c1fb2297 +Subproject commit b4ea62dfda376354aaae1482441a21ee06348580