Use rpl::empty instead of rpl::empty_value().

This commit is contained in:
John Preston 2022-03-11 09:55:21 +04:00
parent 437fe4ba82
commit 32d09f189b
33 changed files with 57 additions and 119 deletions

View file

@ -309,7 +309,7 @@ void EditCaptionBox::setupShadows() {
void EditCaptionBox::setupControls() { void EditCaptionBox::setupControls() {
auto hintLabelToggleOn = _previewRebuilds.events_starting_with( auto hintLabelToggleOn = _previewRebuilds.events_starting_with(
rpl::empty_value() {}
) | rpl::map([=] { ) | rpl::map([=] {
return _controller->session().settings().photoEditorHintShown() return _controller->session().settings().photoEditorHintShown()
? _isPhoto ? _isPhoto
@ -334,9 +334,7 @@ void EditCaptionBox::setupControls() {
st::defaultBoxCheckbox), st::defaultBoxCheckbox),
st::editMediaCheckboxMargins) st::editMediaCheckboxMargins)
)->toggleOn( )->toggleOn(
_previewRebuilds.events_starting_with( _previewRebuilds.events_starting_with({}) | rpl::map([=] {
rpl::empty_value()
) | rpl::map([=] {
return _isPhoto return _isPhoto
&& CanBeCompressed(_albumType) && CanBeCompressed(_albumType)
&& !_preparedList.files.empty(); && !_preparedList.files.empty();

View file

@ -269,9 +269,7 @@ void EditPrivacyBox::setupContent() {
}; };
const auto addExceptionLink = [=](Exception exception) { const auto addExceptionLink = [=](Exception exception) {
const auto update = Ui::CreateChild<rpl::event_stream<>>(content); const auto update = Ui::CreateChild<rpl::event_stream<>>(content);
auto label = update->events_starting_with( auto label = update->events_starting_with({}) | rpl::map([=] {
rpl::empty_value()
) | rpl::map([=] {
return Settings::ExceptionUsersCount(exceptions(exception)); return Settings::ExceptionUsersCount(exceptions(exception));
}) | rpl::map([](int count) { }) | rpl::map([](int count) {
return count return count

View file

@ -237,7 +237,7 @@ object_ptr<Ui::RpWidget> CreateFingerprintAndSignalBars(
QImage::Format_ARGB32_Premultiplied); QImage::Format_ARGB32_Premultiplied);
background->setDevicePixelRatio(cRetinaFactor()); background->setDevicePixelRatio(cRetinaFactor());
rpl::merge( rpl::merge(
rpl::single(rpl::empty_value()), rpl::single(rpl::empty),
Ui::Emoji::Updated(), Ui::Emoji::Updated(),
style::PaletteChanged() style::PaletteChanged()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {

View file

@ -165,9 +165,9 @@ void ScheduleGroupCallBox(
using namespace rpl::mappers; using namespace rpl::mappers;
*duration = rpl::combine( *duration = rpl::combine(
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value() base::timer_each(kLabelRefreshInterval)
) | rpl::then(base::timer_each(kLabelRefreshInterval)), ),
std::move(descriptor.values) | rpl::filter(_1 != 0), std::move(descriptor.values) | rpl::filter(_1 != 0),
_2 _2
) | rpl::map([](TimeId date) { ) | rpl::map([](TimeId date) {

View file

@ -728,7 +728,7 @@ void Panel::setupScheduledLabels(rpl::producer<TimeId> date) {
date date
) | rpl::map([=](TimeId date) { ) | rpl::map([=](TimeId date) {
_countdownData = std::make_shared<Ui::GroupCallScheduledLeft>(date); _countdownData = std::make_shared<Ui::GroupCallScheduledLeft>(date);
return rpl::empty_value(); return rpl::empty;
}) | rpl::start_spawning(lifetime()); }) | rpl::start_spawning(lifetime());
_countdown = Ui::CreateGradientLabel(widget(), rpl::duplicate( _countdown = Ui::CreateGradientLabel(widget(), rpl::duplicate(
@ -1742,9 +1742,7 @@ void Panel::setupControlsBackgroundNarrow() {
const auto full = lifetime.make_state<QImage>( const auto full = lifetime.make_state<QImage>(
QSize(1, height * factor), QSize(1, height * factor),
QImage::Format_ARGB32_Premultiplied); QImage::Format_ARGB32_Premultiplied);
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
style::PaletteChanged() style::PaletteChanged()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
full->fill(Qt::transparent); full->fill(Qt::transparent);

View file

@ -364,9 +364,7 @@ void Row::setupContent(const Set &set) {
) | rpl::map([=](Loader *loader) { ) | rpl::map([=](Loader *loader) {
return (loader && loader->id() == _id) return (loader && loader->id() == _id)
? loader->state() ? loader->state()
: rpl::single( : rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
Updated() Updated()
) | rpl::map([=] { ) | rpl::map([=] {
return ComputeState(_id); return ComputeState(_id);

View file

@ -211,9 +211,7 @@ rpl::producer<SparseIdsMergedSlice> SharedScheduledMediaViewer(
const auto history = session->data().history(key.mergedKey.peerId); const auto history = session->data().history(key.mergedKey.peerId);
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
session->data().scheduledMessages().updates(history) session->data().scheduledMessages().updates(history)
) | rpl::map([=] { ) | rpl::map([=] {
const auto list = session->data().scheduledMessages().list(history); const auto list = session->data().scheduledMessages().list(history);

View file

@ -286,7 +286,7 @@ Widget::Widget(
if (!Core::UpdaterDisabled()) { if (!Core::UpdaterDisabled()) {
Core::UpdateChecker checker; Core::UpdateChecker checker;
rpl::merge( rpl::merge(
rpl::single(rpl::empty_value()), rpl::single(rpl::empty),
checker.isLatest(), checker.isLatest(),
checker.failed(), checker.failed(),
checker.ready() checker.ready()
@ -303,9 +303,7 @@ Widget::Widget(
_cancelSearch->setClickedCallback([this] { onCancelSearch(); }); _cancelSearch->setClickedCallback([this] { onCancelSearch(); });
_jumpToDate->entity()->setClickedCallback([this] { showCalendar(); }); _jumpToDate->entity()->setClickedCallback([this] { showCalendar(); });
_chooseFromUser->entity()->setClickedCallback([this] { showSearchFrom(); }); _chooseFromUser->entity()->setClickedCallback([this] { showSearchFrom(); });
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
session().domain().local().localPasscodeChanged() session().domain().local().localPasscodeChanged()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
updateLockUnlockVisibility(); updateLockUnlockVisibility();
@ -519,9 +517,7 @@ void Widget::setupSupportMode() {
void Widget::setupMainMenuToggle() { void Widget::setupMainMenuToggle() {
_mainMenuToggle->setClickedCallback([=] { showMainMenu(); }); _mainMenuToggle->setClickedCallback([=] { showMainMenu(); });
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
controller()->filtersMenuChanged() controller()->filtersMenuChanged()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
const auto filtersHidden = !controller()->filtersWidth(); const auto filtersHidden = !controller()->filtersWidth();

View file

@ -352,9 +352,9 @@ PhotoEditorControls::PhotoEditorControls(
}, _stickersButton->lifetime()); }, _stickersButton->lifetime());
} }
rpl::single( rpl::single(rpl::empty) | rpl::skip(
rpl::empty_value() modifications.flipped ? 0 : 1
) | rpl::skip(modifications.flipped ? 0 : 1) | rpl::then( ) | rpl::then(
_flipButton->clicks() | rpl::to_empty _flipButton->clicks() | rpl::to_empty
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
_flipped = !_flipped; _flipped = !_flipped;

View file

@ -1600,9 +1600,7 @@ void SetupManagerList(
not_null<Main::Session*> session, not_null<Main::Session*> session,
rpl::producer<std::optional<base::flat_set<QString>>> filter) { rpl::producer<std::optional<base::flat_set<QString>>> filter) {
const auto reactions = &session->data().reactions(); const auto reactions = &session->data().reactions();
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
reactions->updates() reactions->updates()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
manager->applyList( manager->applyList(

View file

@ -1096,9 +1096,7 @@ rpl::producer<Data::MessagesSlice> ScheduledWidget::listSource(
int limitBefore, int limitBefore,
int limitAfter) { int limitAfter) {
const auto data = &controller()->session().data(); const auto data = &controller()->session().data();
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
data->scheduledMessages().updates(_history) data->scheduledMessages().updates(_history)
) | rpl::map([=] { ) | rpl::map([=] {
return data->scheduledMessages().list(_history); return data->scheduledMessages().list(_history);

View file

@ -89,9 +89,7 @@ void Provider::refreshViewer() {
return; return;
} }
auto &manager = Core::App().downloadManager(); auto &manager = Core::App().downloadManager();
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
manager.loadingListChanges() | rpl::to_empty manager.loadingListChanges() | rpl::to_empty
) | rpl::start_with_next([=, &manager] { ) | rpl::start_with_next([=, &manager] {
auto copy = _downloading; auto copy = _downloading;

View file

@ -405,9 +405,7 @@ rpl::producer<bool> CanAddMemberValue(not_null<PeerData*> peer) {
rpl::producer<int> FullReactionsCountValue( rpl::producer<int> FullReactionsCountValue(
not_null<Main::Session*> session) { not_null<Main::Session*> session) {
const auto reactions = &session->data().reactions(); const auto reactions = &session->data().reactions();
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
reactions->updates() reactions->updates()
) | rpl::map([=] { ) | rpl::map([=] {
return int(reactions->list(Data::Reactions::Type::Active).size()); return int(reactions->list(Data::Reactions::Type::Active).size());

View file

@ -75,9 +75,7 @@ namespace {
) | rpl::map([](const QByteArray &code) { ) | rpl::map([](const QByteArray &code) {
return Qr::Encode(code, Qr::Redundancy::Quartile); return Qr::Encode(code, Qr::Redundancy::Quartile);
}); });
auto palettes = rpl::single( auto palettes = rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
style::PaletteChanged() style::PaletteChanged()
); );
auto result = Ui::CreateChild<Ui::RpWidget>(parent.get()); auto result = Ui::CreateChild<Ui::RpWidget>(parent.get());

View file

@ -149,7 +149,7 @@ Widget::Widget(
Core::UpdateChecker checker; Core::UpdateChecker checker;
checker.start(); checker.start();
rpl::merge( rpl::merge(
rpl::single(rpl::empty_value()), rpl::single(rpl::empty),
checker.isLatest(), checker.isLatest(),
checker.failed(), checker.failed(),
checker.ready() checker.ready()

View file

@ -688,9 +688,7 @@ TimeId CalculateOnlineTill(not_null<PeerData*> peer) {
updateUserpics(); updateUserpics();
}; };
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
_session->data().pinnedDialogsOrderUpdated() _session->data().pinnedDialogsOrderUpdated()
) | rpl::start_with_next(updatePinnedChats, _lifetime); ) | rpl::start_with_next(updatePinnedChats, _lifetime);

View file

@ -443,9 +443,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
AddSubsectionTitle(aboutRows, tr::lng_filters_recommended()); AddSubsectionTitle(aboutRows, tr::lng_filters_recommended());
const auto suggested = lifetime.make_state<rpl::variable<int>>(); const auto suggested = lifetime.make_state<rpl::variable<int>>();
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
session->data().chatsFilters().suggestedUpdated() session->data().chatsFilters().suggestedUpdated()
) | rpl::map([=] { ) | rpl::map([=] {
return session->data().chatsFilters().suggestedFilters(); return session->data().chatsFilters().suggestedFilters();

View file

@ -301,9 +301,7 @@ void SetupSections(
} }
}; };
slided->toggleOn( slided->toggleOn(
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
account->appConfig().refreshed() account->appConfig().refreshed()
) | rpl::map( ) | rpl::map(
enabled enabled

View file

@ -229,9 +229,7 @@ void SetupLocalPasscode(
AddSkip(container); AddSkip(container);
AddSubsectionTitle(container, tr::lng_settings_passcode_title()); AddSubsectionTitle(container, tr::lng_settings_passcode_title());
auto has = rpl::single( auto has = rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
controller->session().domain().local().localPasscodeChanged() controller->session().domain().local().localPasscodeChanged()
) | rpl::map([=] { ) | rpl::map([=] {
return controller->session().domain().local().hasLocalPasscode(); return controller->session().domain().local().hasLocalPasscode();
@ -272,7 +270,7 @@ void SetupLocalPasscode(
? tr::lng_passcode_autolock_away ? tr::lng_passcode_autolock_away
: tr::lng_passcode_autolock_inactive; : tr::lng_passcode_autolock_inactive;
auto value = autoLockBoxClosing->events_starting_with( auto value = autoLockBoxClosing->events_starting_with(
rpl::empty_value() {}
) | rpl::map([] { ) | rpl::map([] {
const auto autolock = Core::App().settings().autoLock(); const auto autolock = Core::App().settings().autoLock();
const auto hours = autolock / 3600; const auto hours = autolock / 3600;
@ -471,9 +469,7 @@ void SetupCloudPassword(
) | rpl::filter([](TimeId time) { ) | rpl::filter([](TimeId time) {
return time != 0; return time != 0;
}) | rpl::map([](TimeId time) { }) | rpl::map([](TimeId time) {
return rpl::single( return rpl::single(rpl::empty) | rpl::then(base::timer_each(
rpl::empty_value()
) | rpl::then(base::timer_each(
999 999
)) | rpl::map([=] { )) | rpl::map([=] {
const auto now = base::unixtime::now(); const auto now = base::unixtime::now();

View file

@ -47,9 +47,7 @@ ItemSingleFilePreview::ItemSingleFilePreview(
_documentMedia = document->createMediaView(); _documentMedia = document->createMediaView();
_documentMedia->thumbnailWanted(item->fullId()); _documentMedia->thumbnailWanted(item->fullId());
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
document->session().downloaderTaskFinished() document->session().downloaderTaskFinished()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
if (_documentMedia->thumbnail()) { if (_documentMedia->thumbnail()) {

View file

@ -82,9 +82,7 @@ ItemSingleMediaPreview::ItemSingleMediaPreview(
} }
}; };
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
session->downloaderTaskFinished() session->downloaderTaskFinished()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
const auto computed = computeThumbInfo(); const auto computed = computeThumbInfo();

View file

@ -181,7 +181,7 @@ void SetupSendAsButton(
const auto channel = peer->asMegagroup(); const auto channel = peer->asMegagroup();
auto updates = rpl::single( auto updates = rpl::single(
rpl::empty_value() rpl::empty
) | rpl::then(channel->session().sendAsPeers().updated( ) | rpl::then(channel->session().sendAsPeers().updated(
) | rpl::filter( ) | rpl::filter(
_1 == channel _1 == channel

View file

@ -231,9 +231,7 @@ void GroupCallBar::setupInner() {
static_cast<QMouseEvent*>(event.get())->pos()); static_cast<QMouseEvent*>(event.get())->pos());
}); });
}) | rpl::flatten_latest( }) | rpl::flatten_latest(
) | rpl::map([] { ) | rpl::to_empty | rpl::start_to_stream(_barClicks, _inner->lifetime());
return rpl::empty_value();
}) | rpl::start_to_stream(_barClicks, _inner->lifetime());
_wrap.geometryValue( _wrap.geometryValue(
) | rpl::start_with_next([=](QRect rect) { ) | rpl::start_with_next([=](QRect rect) {

View file

@ -135,13 +135,15 @@ void PinnedBar::createControls() {
static_cast<QMouseEvent*>(event.get())->pos()); static_cast<QMouseEvent*>(event.get())->pos());
}); });
}) | rpl::flatten_latest( }) | rpl::flatten_latest(
) | rpl::map([] { ) | rpl::to_empty | rpl::start_to_stream(
return rpl::empty_value(); _barClicks,
}) | rpl::start_to_stream(_barClicks, _bar->widget()->lifetime()); _bar->widget()->lifetime());
_bar->widget()->move(0, 0); _bar->widget()->move(0, 0);
_bar->widget()->show(); _bar->widget()->show();
_wrap.entity()->resize(_wrap.entity()->width(), _bar->widget()->height()); _wrap.entity()->resize(
_wrap.entity()->width(),
_bar->widget()->height());
_wrap.geometryValue( _wrap.geometryValue(
) | rpl::start_with_next([=](QRect rect) { ) | rpl::start_with_next([=](QRect rect) {

View file

@ -124,9 +124,7 @@ void RequestsBar::setupInner() {
static_cast<QMouseEvent*>(event.get())->pos()); static_cast<QMouseEvent*>(event.get())->pos());
}); });
}) | rpl::flatten_latest( }) | rpl::flatten_latest(
) | rpl::map([] { ) | rpl::to_empty | rpl::start_to_stream(_barClicks, _inner->lifetime());
return rpl::empty_value();
}) | rpl::start_to_stream(_barClicks, _inner->lifetime());
_wrap.geometryValue( _wrap.geometryValue(
) | rpl::start_with_next([=](QRect rect) { ) | rpl::start_with_next([=](QRect rect) {

View file

@ -74,9 +74,7 @@ AbstractSectionWidget::AbstractSectionWidget(
peerForBackground peerForBackground
) | rpl::map([=](PeerData *peer) -> rpl::producer<> { ) | rpl::map([=](PeerData *peer) -> rpl::producer<> {
if (!peer) { if (!peer) {
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
controller->defaultChatTheme()->repaintBackgroundRequests() controller->defaultChatTheme()->repaintBackgroundRequests()
); );
} }
@ -84,9 +82,7 @@ AbstractSectionWidget::AbstractSectionWidget(
controller, controller,
peer peer
) | rpl::map([](const std::shared_ptr<Ui::ChatTheme> &theme) { ) | rpl::map([](const std::shared_ptr<Ui::ChatTheme> &theme) {
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
theme->repaintBackgroundRequests() theme->repaintBackgroundRequests()
); );
}) | rpl::flatten_latest(); }) | rpl::flatten_latest();

View file

@ -1371,9 +1371,7 @@ rpl::producer<bool> IsNightModeValue() {
return update.type == BackgroundUpdate::Type::ApplyingTheme; return update.type == BackgroundUpdate::Type::ApplyingTheme;
}) | rpl::to_empty; }) | rpl::to_empty;
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
std::move(changes) std::move(changes)
) | rpl::map([=] { ) | rpl::map([=] {
return IsNightMode(); return IsNightMode();
@ -1455,9 +1453,7 @@ bool LoadFromContent(
} }
rpl::producer<bool> IsThemeDarkValue() { rpl::producer<bool> IsThemeDarkValue() {
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
style::PaletteChanged() style::PaletteChanged()
) | rpl::map([] { ) | rpl::map([] {
return (st::dialogsBg->c.valueF() < kDarkValueThreshold); return (st::dialogsBg->c.valueF() < kDarkValueThreshold);

View file

@ -336,9 +336,7 @@ void CloudList::setup() {
object.cloud.id ? object.cloud.id : kFakeCloudThemeId)); object.cloud.id ? object.cloud.id : kFakeCloudThemeId));
}); });
auto cloudListChanges = rpl::single( auto cloudListChanges = rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
_window->session().data().cloudThemes().updated() _window->session().data().cloudThemes().updated()
); );

View file

@ -222,7 +222,7 @@ ConnectionState::ConnectionState(
if (!Core::UpdaterDisabled()) { if (!Core::UpdaterDisabled()) {
Core::UpdateChecker checker; Core::UpdateChecker checker;
rpl::merge( rpl::merge(
rpl::single(rpl::empty_value()), rpl::single(rpl::empty),
checker.ready() checker.ready()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
refreshState(); refreshState();

View file

@ -34,7 +34,7 @@ namespace {
[[nodiscard]] rpl::producer<Dialogs::UnreadState> MainListUnreadState( [[nodiscard]] rpl::producer<Dialogs::UnreadState> MainListUnreadState(
not_null<Dialogs::MainList*> list) { not_null<Dialogs::MainList*> list) {
return rpl::single(rpl::empty_value()) | rpl::then( return rpl::single(rpl::empty) | rpl::then(
list->unreadStateChanges() | rpl::to_empty list->unreadStateChanges() | rpl::to_empty
) | rpl::map([=] { ) | rpl::map([=] {
return list->unreadState(); return list->unreadState();
@ -103,9 +103,7 @@ void FiltersMenu::setup() {
}, _outer.lifetime()); }, _outer.lifetime());
const auto filters = &_session->session().data().chatsFilters(); const auto filters = &_session->session().data().chatsFilters();
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
filters->changed() filters->changed()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
refresh(); refresh();

View file

@ -240,9 +240,7 @@ void AddUnreadBadge(
const auto state = raw->lifetime().make_state<State>(raw); const auto state = raw->lifetime().make_state<State>(raw);
if (!active) { if (!active) {
AddUnreadBadge(raw, rpl::single( AddUnreadBadge(raw, rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
session->data().unreadBadgeChanges() session->data().unreadBadgeChanges()
) | rpl::map([=] { ) | rpl::map([=] {
auto &owner = session->data(); auto &owner = session->data();
@ -380,9 +378,7 @@ protected:
MainMenu::ToggleAccountsButton::ToggleAccountsButton(QWidget *parent) MainMenu::ToggleAccountsButton::ToggleAccountsButton(QWidget *parent)
: AbstractButton(parent) { : AbstractButton(parent) {
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
Core::App().unreadBadgeChanges() Core::App().unreadBadgeChanges()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
_unreadBadgeStale = true; _unreadBadgeStale = true;
@ -743,9 +739,7 @@ void MainMenu::setupArchive() {
return folder && (folder->id() == Data::Folder::kId); return folder && (folder->id() == Data::Folder::kId);
}) | rpl::take(1); }) | rpl::take(1);
AddUnreadBadge(button, rpl::single( AddUnreadBadge(button, rpl::single(rpl::empty) | rpl::then(std::move(
rpl::empty_value()
) | rpl::then(std::move(
folderValue folderValue
) | rpl::map([=](not_null<Data::Folder*> folder) { ) | rpl::map([=](not_null<Data::Folder*> folder) {
return folder->owner().chatsList(folder)->unreadStateChanges(); return folder->owner().chatsList(folder)->unreadStateChanges();
@ -789,10 +783,9 @@ void MainMenu::setupAccounts() {
_addAccount = setupAddAccount(inner); _addAccount = setupAddAccount(inner);
inner->add(object_ptr<Ui::FixedHeightWidget>(inner, st::mainMenuSkip)); inner->add(object_ptr<Ui::FixedHeightWidget>(inner, st::mainMenuSkip));
rpl::single( rpl::single(rpl::empty) | rpl::then(
rpl::empty_value() Core::App().domain().accountsChanges()
) | rpl::then(Core::App().domain().accountsChanges( ) | rpl::start_with_next([=] {
)) | rpl::start_with_next([=] {
const auto &list = Core::App().domain().accounts(); const auto &list = Core::App().domain().accounts();
const auto exists = [&](not_null<Main::Account*> account) { const auto exists = [&](not_null<Main::Account*> account) {
for (const auto &[index, existing] : list) { for (const auto &[index, existing] : list) {
@ -1206,12 +1199,9 @@ OthersUnreadState OtherAccountsUnreadStateCurrent() {
} }
rpl::producer<OthersUnreadState> OtherAccountsUnreadState() { rpl::producer<OthersUnreadState> OtherAccountsUnreadState() {
return rpl::single( return rpl::single(rpl::empty) | rpl::then(
rpl::empty_value()
) | rpl::then(
Core::App().unreadBadgeChanges() Core::App().unreadBadgeChanges()
) | rpl::map(OtherAccountsUnreadStateCurrent); ) | rpl::map(OtherAccountsUnreadStateCurrent);
} }
} // namespace Window } // namespace Window

@ -1 +1 @@
Subproject commit 3669e28e8767669dda7ff2d847eb2e30d18ea796 Subproject commit 03698385aa794fafd613a745371b5ade556ce5fa

@ -1 +1 @@
Subproject commit 94a42b775ab4e46e5edeb88d8ed6c06f9e869c61 Subproject commit 6ee3948b61cffdab672d75ea33266ea00731b3cf