From 32d09f189b34fd8c0954c29537ecb753de09a073 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2022 09:55:21 +0400 Subject: [PATCH] Use rpl::empty instead of rpl::empty_value(). --- .../SourceFiles/boxes/edit_caption_box.cpp | 6 ++--- .../SourceFiles/boxes/edit_privacy_box.cpp | 4 +--- .../calls/calls_emoji_fingerprint.cpp | 2 +- .../calls/group/calls_choose_join_as.cpp | 6 ++--- .../calls/group/calls_group_panel.cpp | 6 ++--- .../chat_helpers/emoji_sets_manager.cpp | 4 +--- .../SourceFiles/data/data_shared_media.cpp | 4 +--- .../SourceFiles/dialogs/dialogs_widget.cpp | 10 +++----- .../editor/photo_editor_controls.cpp | 6 ++--- .../view/history_view_react_button.cpp | 4 +--- .../view/history_view_scheduled_section.cpp | 4 +--- .../downloads/info_downloads_provider.cpp | 4 +--- .../info/profile/info_profile_values.cpp | 4 +--- Telegram/SourceFiles/intro/intro_qr.cpp | 4 +--- Telegram/SourceFiles/intro/intro_widget.cpp | 2 +- .../touchbar/items/mac_pinned_chats_item.mm | 4 +--- .../SourceFiles/settings/settings_folders.cpp | 4 +--- .../SourceFiles/settings/settings_main.cpp | 4 +--- .../settings/settings_privacy_security.cpp | 10 +++----- .../attach_item_single_file_preview.cpp | 4 +--- .../attach_item_single_media_preview.cpp | 4 +--- .../SourceFiles/ui/chat/choose_send_as.cpp | 2 +- .../SourceFiles/ui/chat/group_call_bar.cpp | 4 +--- Telegram/SourceFiles/ui/chat/pinned_bar.cpp | 10 ++++---- Telegram/SourceFiles/ui/chat/requests_bar.cpp | 4 +--- .../SourceFiles/window/section_widget.cpp | 8 ++----- .../window/themes/window_theme.cpp | 8 ++----- .../themes/window_themes_cloud_list.cpp | 4 +--- .../window/window_connecting_widget.cpp | 2 +- .../window/window_filters_menu.cpp | 6 ++--- .../SourceFiles/window/window_main_menu.cpp | 24 ++++++------------- Telegram/lib_base | 2 +- Telegram/lib_rpl | 2 +- 33 files changed, 57 insertions(+), 119 deletions(-) diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index 9982913ec..b1f82ff1b 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -309,7 +309,7 @@ void EditCaptionBox::setupShadows() { void EditCaptionBox::setupControls() { auto hintLabelToggleOn = _previewRebuilds.events_starting_with( - rpl::empty_value() + {} ) | rpl::map([=] { return _controller->session().settings().photoEditorHintShown() ? _isPhoto @@ -334,9 +334,7 @@ void EditCaptionBox::setupControls() { st::defaultBoxCheckbox), st::editMediaCheckboxMargins) )->toggleOn( - _previewRebuilds.events_starting_with( - rpl::empty_value() - ) | rpl::map([=] { + _previewRebuilds.events_starting_with({}) | rpl::map([=] { return _isPhoto && CanBeCompressed(_albumType) && !_preparedList.files.empty(); diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 02a100d0b..aa67f1530 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -269,9 +269,7 @@ void EditPrivacyBox::setupContent() { }; const auto addExceptionLink = [=](Exception exception) { const auto update = Ui::CreateChild>(content); - auto label = update->events_starting_with( - rpl::empty_value() - ) | rpl::map([=] { + auto label = update->events_starting_with({}) | rpl::map([=] { return Settings::ExceptionUsersCount(exceptions(exception)); }) | rpl::map([](int count) { return count diff --git a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp index 61ec38db5..05a4d0982 100644 --- a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp +++ b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp @@ -237,7 +237,7 @@ object_ptr CreateFingerprintAndSignalBars( QImage::Format_ARGB32_Premultiplied); background->setDevicePixelRatio(cRetinaFactor()); rpl::merge( - rpl::single(rpl::empty_value()), + rpl::single(rpl::empty), Ui::Emoji::Updated(), style::PaletteChanged() ) | rpl::start_with_next([=] { diff --git a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp index f84dcdda3..6d5990ea9 100644 --- a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp +++ b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp @@ -165,9 +165,9 @@ void ScheduleGroupCallBox( using namespace rpl::mappers; *duration = rpl::combine( - rpl::single( - rpl::empty_value() - ) | rpl::then(base::timer_each(kLabelRefreshInterval)), + rpl::single(rpl::empty) | rpl::then( + base::timer_each(kLabelRefreshInterval) + ), std::move(descriptor.values) | rpl::filter(_1 != 0), _2 ) | rpl::map([](TimeId date) { diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index 8758cc8f7..9b6ea3a72 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -728,7 +728,7 @@ void Panel::setupScheduledLabels(rpl::producer date) { date ) | rpl::map([=](TimeId date) { _countdownData = std::make_shared(date); - return rpl::empty_value(); + return rpl::empty; }) | rpl::start_spawning(lifetime()); _countdown = Ui::CreateGradientLabel(widget(), rpl::duplicate( @@ -1742,9 +1742,7 @@ void Panel::setupControlsBackgroundNarrow() { const auto full = lifetime.make_state( QSize(1, height * factor), QImage::Format_ARGB32_Premultiplied); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( style::PaletteChanged() ) | rpl::start_with_next([=] { full->fill(Qt::transparent); diff --git a/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp b/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp index 8364bdc7f..7aaa3800f 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp @@ -364,9 +364,7 @@ void Row::setupContent(const Set &set) { ) | rpl::map([=](Loader *loader) { return (loader && loader->id() == _id) ? loader->state() - : rpl::single( - rpl::empty_value() - ) | rpl::then( + : rpl::single(rpl::empty) | rpl::then( Updated() ) | rpl::map([=] { return ComputeState(_id); diff --git a/Telegram/SourceFiles/data/data_shared_media.cpp b/Telegram/SourceFiles/data/data_shared_media.cpp index 87851c62f..53480ceb9 100644 --- a/Telegram/SourceFiles/data/data_shared_media.cpp +++ b/Telegram/SourceFiles/data/data_shared_media.cpp @@ -211,9 +211,7 @@ rpl::producer SharedScheduledMediaViewer( const auto history = session->data().history(key.mergedKey.peerId); - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( session->data().scheduledMessages().updates(history) ) | rpl::map([=] { const auto list = session->data().scheduledMessages().list(history); diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 38ab85cd1..5c3caaae0 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -286,7 +286,7 @@ Widget::Widget( if (!Core::UpdaterDisabled()) { Core::UpdateChecker checker; rpl::merge( - rpl::single(rpl::empty_value()), + rpl::single(rpl::empty), checker.isLatest(), checker.failed(), checker.ready() @@ -303,9 +303,7 @@ Widget::Widget( _cancelSearch->setClickedCallback([this] { onCancelSearch(); }); _jumpToDate->entity()->setClickedCallback([this] { showCalendar(); }); _chooseFromUser->entity()->setClickedCallback([this] { showSearchFrom(); }); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( session().domain().local().localPasscodeChanged() ) | rpl::start_with_next([=] { updateLockUnlockVisibility(); @@ -519,9 +517,7 @@ void Widget::setupSupportMode() { void Widget::setupMainMenuToggle() { _mainMenuToggle->setClickedCallback([=] { showMainMenu(); }); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( controller()->filtersMenuChanged() ) | rpl::start_with_next([=] { const auto filtersHidden = !controller()->filtersWidth(); diff --git a/Telegram/SourceFiles/editor/photo_editor_controls.cpp b/Telegram/SourceFiles/editor/photo_editor_controls.cpp index b9e1963ee..a05092fcf 100644 --- a/Telegram/SourceFiles/editor/photo_editor_controls.cpp +++ b/Telegram/SourceFiles/editor/photo_editor_controls.cpp @@ -352,9 +352,9 @@ PhotoEditorControls::PhotoEditorControls( }, _stickersButton->lifetime()); } - rpl::single( - rpl::empty_value() - ) | rpl::skip(modifications.flipped ? 0 : 1) | rpl::then( + rpl::single(rpl::empty) | rpl::skip( + modifications.flipped ? 0 : 1 + ) | rpl::then( _flipButton->clicks() | rpl::to_empty ) | rpl::start_with_next([=] { _flipped = !_flipped; diff --git a/Telegram/SourceFiles/history/view/history_view_react_button.cpp b/Telegram/SourceFiles/history/view/history_view_react_button.cpp index 4453ae48e..a2a6a9e6f 100644 --- a/Telegram/SourceFiles/history/view/history_view_react_button.cpp +++ b/Telegram/SourceFiles/history/view/history_view_react_button.cpp @@ -1600,9 +1600,7 @@ void SetupManagerList( not_null session, rpl::producer>> filter) { const auto reactions = &session->data().reactions(); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( reactions->updates() ) | rpl::start_with_next([=] { manager->applyList( diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index 122769f27..21cb9eafa 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -1096,9 +1096,7 @@ rpl::producer ScheduledWidget::listSource( int limitBefore, int limitAfter) { const auto data = &controller()->session().data(); - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( data->scheduledMessages().updates(_history) ) | rpl::map([=] { return data->scheduledMessages().list(_history); diff --git a/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp b/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp index f984ba1e6..978c46582 100644 --- a/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp +++ b/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp @@ -89,9 +89,7 @@ void Provider::refreshViewer() { return; } auto &manager = Core::App().downloadManager(); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( manager.loadingListChanges() | rpl::to_empty ) | rpl::start_with_next([=, &manager] { auto copy = _downloading; diff --git a/Telegram/SourceFiles/info/profile/info_profile_values.cpp b/Telegram/SourceFiles/info/profile/info_profile_values.cpp index 7074def56..e89de330e 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_values.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_values.cpp @@ -405,9 +405,7 @@ rpl::producer CanAddMemberValue(not_null peer) { rpl::producer FullReactionsCountValue( not_null session) { const auto reactions = &session->data().reactions(); - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( reactions->updates() ) | rpl::map([=] { return int(reactions->list(Data::Reactions::Type::Active).size()); diff --git a/Telegram/SourceFiles/intro/intro_qr.cpp b/Telegram/SourceFiles/intro/intro_qr.cpp index 8774ebadf..bd4db429c 100644 --- a/Telegram/SourceFiles/intro/intro_qr.cpp +++ b/Telegram/SourceFiles/intro/intro_qr.cpp @@ -75,9 +75,7 @@ namespace { ) | rpl::map([](const QByteArray &code) { return Qr::Encode(code, Qr::Redundancy::Quartile); }); - auto palettes = rpl::single( - rpl::empty_value() - ) | rpl::then( + auto palettes = rpl::single(rpl::empty) | rpl::then( style::PaletteChanged() ); auto result = Ui::CreateChild(parent.get()); diff --git a/Telegram/SourceFiles/intro/intro_widget.cpp b/Telegram/SourceFiles/intro/intro_widget.cpp index 138a1cf56..938e327aa 100644 --- a/Telegram/SourceFiles/intro/intro_widget.cpp +++ b/Telegram/SourceFiles/intro/intro_widget.cpp @@ -149,7 +149,7 @@ Widget::Widget( Core::UpdateChecker checker; checker.start(); rpl::merge( - rpl::single(rpl::empty_value()), + rpl::single(rpl::empty), checker.isLatest(), checker.failed(), checker.ready() diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm index ede7a58f9..09d9b9c90 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.mm @@ -688,9 +688,7 @@ TimeId CalculateOnlineTill(not_null peer) { updateUserpics(); }; - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( _session->data().pinnedDialogsOrderUpdated() ) | rpl::start_with_next(updatePinnedChats, _lifetime); diff --git a/Telegram/SourceFiles/settings/settings_folders.cpp b/Telegram/SourceFiles/settings/settings_folders.cpp index db5e20fe0..646191e57 100644 --- a/Telegram/SourceFiles/settings/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/settings_folders.cpp @@ -443,9 +443,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { AddSubsectionTitle(aboutRows, tr::lng_filters_recommended()); const auto suggested = lifetime.make_state>(); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( session->data().chatsFilters().suggestedUpdated() ) | rpl::map([=] { return session->data().chatsFilters().suggestedFilters(); diff --git a/Telegram/SourceFiles/settings/settings_main.cpp b/Telegram/SourceFiles/settings/settings_main.cpp index 4284de925..8300eb11c 100644 --- a/Telegram/SourceFiles/settings/settings_main.cpp +++ b/Telegram/SourceFiles/settings/settings_main.cpp @@ -301,9 +301,7 @@ void SetupSections( } }; slided->toggleOn( - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( account->appConfig().refreshed() ) | rpl::map( enabled diff --git a/Telegram/SourceFiles/settings/settings_privacy_security.cpp b/Telegram/SourceFiles/settings/settings_privacy_security.cpp index b06bdccef..c3500e8af 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_security.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_security.cpp @@ -229,9 +229,7 @@ void SetupLocalPasscode( AddSkip(container); AddSubsectionTitle(container, tr::lng_settings_passcode_title()); - auto has = rpl::single( - rpl::empty_value() - ) | rpl::then( + auto has = rpl::single(rpl::empty) | rpl::then( controller->session().domain().local().localPasscodeChanged() ) | rpl::map([=] { return controller->session().domain().local().hasLocalPasscode(); @@ -272,7 +270,7 @@ void SetupLocalPasscode( ? tr::lng_passcode_autolock_away : tr::lng_passcode_autolock_inactive; auto value = autoLockBoxClosing->events_starting_with( - rpl::empty_value() + {} ) | rpl::map([] { const auto autolock = Core::App().settings().autoLock(); const auto hours = autolock / 3600; @@ -471,9 +469,7 @@ void SetupCloudPassword( ) | rpl::filter([](TimeId time) { return time != 0; }) | rpl::map([](TimeId time) { - return rpl::single( - rpl::empty_value() - ) | rpl::then(base::timer_each( + return rpl::single(rpl::empty) | rpl::then(base::timer_each( 999 )) | rpl::map([=] { const auto now = base::unixtime::now(); diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_item_single_file_preview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_item_single_file_preview.cpp index ac86b65de..fd658d712 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_item_single_file_preview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_item_single_file_preview.cpp @@ -47,9 +47,7 @@ ItemSingleFilePreview::ItemSingleFilePreview( _documentMedia = document->createMediaView(); _documentMedia->thumbnailWanted(item->fullId()); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( document->session().downloaderTaskFinished() ) | rpl::start_with_next([=] { if (_documentMedia->thumbnail()) { diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp index 02751972a..2a6c221ac 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp @@ -82,9 +82,7 @@ ItemSingleMediaPreview::ItemSingleMediaPreview( } }; - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( session->downloaderTaskFinished() ) | rpl::start_with_next([=] { const auto computed = computeThumbInfo(); diff --git a/Telegram/SourceFiles/ui/chat/choose_send_as.cpp b/Telegram/SourceFiles/ui/chat/choose_send_as.cpp index 4daea9956..a51803e92 100644 --- a/Telegram/SourceFiles/ui/chat/choose_send_as.cpp +++ b/Telegram/SourceFiles/ui/chat/choose_send_as.cpp @@ -181,7 +181,7 @@ void SetupSendAsButton( const auto channel = peer->asMegagroup(); auto updates = rpl::single( - rpl::empty_value() + rpl::empty ) | rpl::then(channel->session().sendAsPeers().updated( ) | rpl::filter( _1 == channel diff --git a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp index 8ad33c772..5add6eac4 100644 --- a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp @@ -231,9 +231,7 @@ void GroupCallBar::setupInner() { static_cast(event.get())->pos()); }); }) | rpl::flatten_latest( - ) | rpl::map([] { - return rpl::empty_value(); - }) | rpl::start_to_stream(_barClicks, _inner->lifetime()); + ) | rpl::to_empty | rpl::start_to_stream(_barClicks, _inner->lifetime()); _wrap.geometryValue( ) | rpl::start_with_next([=](QRect rect) { diff --git a/Telegram/SourceFiles/ui/chat/pinned_bar.cpp b/Telegram/SourceFiles/ui/chat/pinned_bar.cpp index 3181835dc..f3c6723e0 100644 --- a/Telegram/SourceFiles/ui/chat/pinned_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/pinned_bar.cpp @@ -135,13 +135,15 @@ void PinnedBar::createControls() { static_cast(event.get())->pos()); }); }) | rpl::flatten_latest( - ) | rpl::map([] { - return rpl::empty_value(); - }) | rpl::start_to_stream(_barClicks, _bar->widget()->lifetime()); + ) | rpl::to_empty | rpl::start_to_stream( + _barClicks, + _bar->widget()->lifetime()); _bar->widget()->move(0, 0); _bar->widget()->show(); - _wrap.entity()->resize(_wrap.entity()->width(), _bar->widget()->height()); + _wrap.entity()->resize( + _wrap.entity()->width(), + _bar->widget()->height()); _wrap.geometryValue( ) | rpl::start_with_next([=](QRect rect) { diff --git a/Telegram/SourceFiles/ui/chat/requests_bar.cpp b/Telegram/SourceFiles/ui/chat/requests_bar.cpp index 620754af9..e0ec4ce68 100644 --- a/Telegram/SourceFiles/ui/chat/requests_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/requests_bar.cpp @@ -124,9 +124,7 @@ void RequestsBar::setupInner() { static_cast(event.get())->pos()); }); }) | rpl::flatten_latest( - ) | rpl::map([] { - return rpl::empty_value(); - }) | rpl::start_to_stream(_barClicks, _inner->lifetime()); + ) | rpl::to_empty | rpl::start_to_stream(_barClicks, _inner->lifetime()); _wrap.geometryValue( ) | rpl::start_with_next([=](QRect rect) { diff --git a/Telegram/SourceFiles/window/section_widget.cpp b/Telegram/SourceFiles/window/section_widget.cpp index 7622eb911..79f91e4b9 100644 --- a/Telegram/SourceFiles/window/section_widget.cpp +++ b/Telegram/SourceFiles/window/section_widget.cpp @@ -74,9 +74,7 @@ AbstractSectionWidget::AbstractSectionWidget( peerForBackground ) | rpl::map([=](PeerData *peer) -> rpl::producer<> { if (!peer) { - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( controller->defaultChatTheme()->repaintBackgroundRequests() ); } @@ -84,9 +82,7 @@ AbstractSectionWidget::AbstractSectionWidget( controller, peer ) | rpl::map([](const std::shared_ptr &theme) { - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( theme->repaintBackgroundRequests() ); }) | rpl::flatten_latest(); diff --git a/Telegram/SourceFiles/window/themes/window_theme.cpp b/Telegram/SourceFiles/window/themes/window_theme.cpp index 18738a871..7214bffd8 100644 --- a/Telegram/SourceFiles/window/themes/window_theme.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme.cpp @@ -1371,9 +1371,7 @@ rpl::producer IsNightModeValue() { return update.type == BackgroundUpdate::Type::ApplyingTheme; }) | rpl::to_empty; - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( std::move(changes) ) | rpl::map([=] { return IsNightMode(); @@ -1455,9 +1453,7 @@ bool LoadFromContent( } rpl::producer IsThemeDarkValue() { - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( style::PaletteChanged() ) | rpl::map([] { return (st::dialogsBg->c.valueF() < kDarkValueThreshold); diff --git a/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp b/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp index 1a1f2528d..5ad865efc 100644 --- a/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp +++ b/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp @@ -336,9 +336,7 @@ void CloudList::setup() { object.cloud.id ? object.cloud.id : kFakeCloudThemeId)); }); - auto cloudListChanges = rpl::single( - rpl::empty_value() - ) | rpl::then( + auto cloudListChanges = rpl::single(rpl::empty) | rpl::then( _window->session().data().cloudThemes().updated() ); diff --git a/Telegram/SourceFiles/window/window_connecting_widget.cpp b/Telegram/SourceFiles/window/window_connecting_widget.cpp index 4b76bbc7a..b9525eb0d 100644 --- a/Telegram/SourceFiles/window/window_connecting_widget.cpp +++ b/Telegram/SourceFiles/window/window_connecting_widget.cpp @@ -222,7 +222,7 @@ ConnectionState::ConnectionState( if (!Core::UpdaterDisabled()) { Core::UpdateChecker checker; rpl::merge( - rpl::single(rpl::empty_value()), + rpl::single(rpl::empty), checker.ready() ) | rpl::start_with_next([=] { refreshState(); diff --git a/Telegram/SourceFiles/window/window_filters_menu.cpp b/Telegram/SourceFiles/window/window_filters_menu.cpp index 282124bf5..36ccdcfc5 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.cpp +++ b/Telegram/SourceFiles/window/window_filters_menu.cpp @@ -34,7 +34,7 @@ namespace { [[nodiscard]] rpl::producer MainListUnreadState( not_null list) { - return rpl::single(rpl::empty_value()) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( list->unreadStateChanges() | rpl::to_empty ) | rpl::map([=] { return list->unreadState(); @@ -103,9 +103,7 @@ void FiltersMenu::setup() { }, _outer.lifetime()); const auto filters = &_session->session().data().chatsFilters(); - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( filters->changed() ) | rpl::start_with_next([=] { refresh(); diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index 82601c67d..4a031a393 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -240,9 +240,7 @@ void AddUnreadBadge( const auto state = raw->lifetime().make_state(raw); if (!active) { - AddUnreadBadge(raw, rpl::single( - rpl::empty_value() - ) | rpl::then( + AddUnreadBadge(raw, rpl::single(rpl::empty) | rpl::then( session->data().unreadBadgeChanges() ) | rpl::map([=] { auto &owner = session->data(); @@ -380,9 +378,7 @@ protected: MainMenu::ToggleAccountsButton::ToggleAccountsButton(QWidget *parent) : AbstractButton(parent) { - rpl::single( - rpl::empty_value() - ) | rpl::then( + rpl::single(rpl::empty) | rpl::then( Core::App().unreadBadgeChanges() ) | rpl::start_with_next([=] { _unreadBadgeStale = true; @@ -743,9 +739,7 @@ void MainMenu::setupArchive() { return folder && (folder->id() == Data::Folder::kId); }) | rpl::take(1); - AddUnreadBadge(button, rpl::single( - rpl::empty_value() - ) | rpl::then(std::move( + AddUnreadBadge(button, rpl::single(rpl::empty) | rpl::then(std::move( folderValue ) | rpl::map([=](not_null folder) { return folder->owner().chatsList(folder)->unreadStateChanges(); @@ -789,10 +783,9 @@ void MainMenu::setupAccounts() { _addAccount = setupAddAccount(inner); inner->add(object_ptr(inner, st::mainMenuSkip)); - rpl::single( - rpl::empty_value() - ) | rpl::then(Core::App().domain().accountsChanges( - )) | rpl::start_with_next([=] { + rpl::single(rpl::empty) | rpl::then( + Core::App().domain().accountsChanges() + ) | rpl::start_with_next([=] { const auto &list = Core::App().domain().accounts(); const auto exists = [&](not_null account) { for (const auto &[index, existing] : list) { @@ -1206,12 +1199,9 @@ OthersUnreadState OtherAccountsUnreadStateCurrent() { } rpl::producer OtherAccountsUnreadState() { - return rpl::single( - rpl::empty_value() - ) | rpl::then( + return rpl::single(rpl::empty) | rpl::then( Core::App().unreadBadgeChanges() ) | rpl::map(OtherAccountsUnreadStateCurrent); } - } // namespace Window diff --git a/Telegram/lib_base b/Telegram/lib_base index 3669e28e8..03698385a 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 3669e28e8767669dda7ff2d847eb2e30d18ea796 +Subproject commit 03698385aa794fafd613a745371b5ade556ce5fa diff --git a/Telegram/lib_rpl b/Telegram/lib_rpl index 94a42b775..6ee3948b6 160000 --- a/Telegram/lib_rpl +++ b/Telegram/lib_rpl @@ -1 +1 @@ -Subproject commit 94a42b775ab4e46e5edeb88d8ed6c06f9e869c61 +Subproject commit 6ee3948b61cffdab672d75ea33266ea00731b3cf