Renamed rpl::start_with_ with rpl::on_.
This commit is contained in:
@@ -95,7 +95,7 @@ void Account::watchProxyChanges() {
|
||||
using ProxyChange = Core::Application::ProxyChange;
|
||||
|
||||
Core::App().proxyChanges(
|
||||
) | rpl::start_with_next([=](const ProxyChange &change) {
|
||||
) | rpl::on_next([=](const ProxyChange &change) {
|
||||
const auto key = [&](const MTP::ProxyData &proxy) {
|
||||
return (proxy.type == MTP::ProxyData::Type::Mtproto)
|
||||
? std::make_pair(proxy.host, proxy.port)
|
||||
@@ -115,7 +115,7 @@ void Account::watchProxyChanges() {
|
||||
|
||||
void Account::watchSessionChanges() {
|
||||
sessionChanges(
|
||||
) | rpl::start_with_next([=](Session *session) {
|
||||
) | rpl::on_next([=](Session *session) {
|
||||
if (!session && _mtp) {
|
||||
_mtp->setUserPhone(QString());
|
||||
}
|
||||
@@ -427,7 +427,7 @@ void Account::startMtp(std::unique_ptr<MTP::Config> config) {
|
||||
_mtp->writeKeysRequests(
|
||||
) | rpl::filter([=] {
|
||||
return !*writingKeys;
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
*writingKeys = true;
|
||||
Ui::PostponeCall(_mtp.get(), [=] {
|
||||
local().writeMtpData();
|
||||
@@ -441,7 +441,7 @@ void Account::startMtp(std::unique_ptr<MTP::Config> config) {
|
||||
_mtp->dcOptions().changed() | rpl::to_empty
|
||||
) | rpl::filter([=] {
|
||||
return !*writingConfig;
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
*writingConfig = true;
|
||||
Ui::PostponeCall(_mtp.get(), [=] {
|
||||
local().writeMtpConfig();
|
||||
@@ -569,11 +569,11 @@ void Account::destroyMtpKeys(MTP::AuthKeysList &&keys) {
|
||||
MTP::Instance::Mode::KeysDestroyer,
|
||||
std::move(destroyFields));
|
||||
_mtpForKeysDestroy->writeKeysRequests(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
local().writeMtpData();
|
||||
}, _mtpForKeysDestroy->lifetime());
|
||||
_mtpForKeysDestroy->allKeysDestroyed(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
LOG(("MTP Info: all keys scheduled for destroy are destroyed."));
|
||||
crl::on_main(this, [=] {
|
||||
_mtpForKeysDestroy = nullptr;
|
||||
|
||||
@@ -27,7 +27,7 @@ AppConfig::AppConfig(not_null<Account*> account) : _account(account) {
|
||||
account->sessionChanges(
|
||||
) | rpl::filter([=](Session *session) {
|
||||
return (session != nullptr);
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
_lastFrozenRefresh = 0;
|
||||
refresh();
|
||||
}, _lifetime);
|
||||
@@ -37,13 +37,13 @@ AppConfig::~AppConfig() = default;
|
||||
|
||||
void AppConfig::start() {
|
||||
_account->mtpMainSessionValue(
|
||||
) | rpl::start_with_next([=](not_null<MTP::Instance*> instance) {
|
||||
) | rpl::on_next([=](not_null<MTP::Instance*> instance) {
|
||||
_api.emplace(instance);
|
||||
_requestId = 0;
|
||||
refresh();
|
||||
|
||||
_frozenTrackLifetime = instance->frozenErrorReceived(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
if (!get<int>(u"freeze_since_date"_q, 0)) {
|
||||
const auto now = crl::now();
|
||||
if (!_lastFrozenRefresh
|
||||
|
||||
@@ -32,7 +32,7 @@ Domain::Domain(const QString &dataName)
|
||||
: _dataName(dataName)
|
||||
, _local(std::make_unique<Storage::Domain>(this, dataName)) {
|
||||
_active.changes(
|
||||
) | rpl::take(1) | rpl::start_with_next([=] {
|
||||
) | rpl::take(1) | rpl::on_next([=] {
|
||||
// In case we had a legacy passcoded app we start settings here.
|
||||
Core::App().startSettingsAndBackground();
|
||||
|
||||
@@ -52,7 +52,7 @@ Domain::Domain(const QString &dataName)
|
||||
Data::PeerUpdate::Flag::Username)
|
||||
: rpl::never<Data::PeerUpdate>();
|
||||
}) | rpl::flatten_latest(
|
||||
) | rpl::start_with_next([](const Data::PeerUpdate &update) {
|
||||
) | rpl::on_next([](const Data::PeerUpdate &update) {
|
||||
CrashReports::SetAnnotation("Username", update.peer->username());
|
||||
}, _lifetime);
|
||||
}
|
||||
@@ -343,15 +343,15 @@ void Domain::watchSession(not_null<Account*> account) {
|
||||
account->sessionValue(
|
||||
) | rpl::filter([=](Session *session) {
|
||||
return session != nullptr;
|
||||
}) | rpl::start_with_next([=](Session *session) {
|
||||
}) | rpl::on_next([=](Session *session) {
|
||||
session->data().unreadBadgeChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
scheduleUpdateUnreadBadge();
|
||||
}, session->lifetime());
|
||||
|
||||
Data::AmPremiumValue(
|
||||
session
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_lastMaxAccounts = maxAccounts();
|
||||
}, session->lifetime());
|
||||
}, account->lifetime());
|
||||
@@ -359,7 +359,7 @@ void Domain::watchSession(not_null<Account*> account) {
|
||||
account->sessionChanges(
|
||||
) | rpl::filter([=](Session *session) {
|
||||
return !session;
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
scheduleUpdateUnreadBadge();
|
||||
closeAccountWindows(account);
|
||||
crl::on_main(&Core::App(), [=] {
|
||||
|
||||
@@ -137,7 +137,7 @@ Session::Session(
|
||||
_promoSuggestions->setupEmailStateValue(
|
||||
) | rpl::filter([](Data::SetupEmailState s) {
|
||||
return s == Data::SetupEmailState::None;
|
||||
}) | rpl::take(1) | rpl::start_with_next(crl::guard(this, [=] {
|
||||
}) | rpl::take(1) | rpl::on_next(crl::guard(this, [=] {
|
||||
Core::App().unlockSetupEmail();
|
||||
_settings->setSetupEmailState(State::None);
|
||||
saveSettingsDelayed(200);
|
||||
@@ -173,7 +173,7 @@ Session::Session(
|
||||
changes().peerFlagsValue(
|
||||
_user,
|
||||
Data::PeerUpdate::Flag::Photo
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
auto view = Ui::PeerUserpicView{ .cloud = _selfUserpicView };
|
||||
[[maybe_unused]] const auto image = _user->userpicCloudImage(view);
|
||||
_selfUserpicView = view.cloud;
|
||||
@@ -188,7 +188,7 @@ Session::Session(
|
||||
| Flag::Photo
|
||||
| Flag::About
|
||||
| Flag::PhoneNumber
|
||||
) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
|
||||
) | rpl::on_next([=](const Data::PeerUpdate &update) {
|
||||
local().writeSelf();
|
||||
|
||||
if (update.flags & Flag::PhoneNumber) {
|
||||
@@ -238,7 +238,7 @@ Session::Session(
|
||||
Core::App().downloadManager().trackSession(this);
|
||||
|
||||
appConfig().value(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
appConfigRefreshed();
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ SendAsPeers::SendAsPeers(not_null<Session*> session)
|
||||
}) | rpl::distinct_until_changed(
|
||||
) | rpl::filter([=](not_null<PeerData*> peer, int) {
|
||||
return _lists.contains(peer) || _lastRequestTime.contains(peer);
|
||||
}) | rpl::start_with_next([=](not_null<PeerData*> peer, int) {
|
||||
}) | rpl::on_next([=](not_null<PeerData*> peer, int) {
|
||||
refresh(peer, true);
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user