2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Allow several accounts in Core::App.

This commit is contained in:
John Preston
2020-06-15 20:25:02 +04:00
parent 815e26eea5
commit 6fc5e22882
36 changed files with 834 additions and 267 deletions

View File

@@ -67,6 +67,7 @@ Session::Session(
) | rpl::start_with_next([=] {
notifications().updateAll();
}, _lifetime);
subscribe(Global::RefConnectionTypeChanged(), [=] {
_api->refreshTopPromotion();
});
@@ -74,6 +75,8 @@ Session::Session(
_api->requestTermsUpdate();
_api->requestFullPeer(_user);
_api->instance()->setUserPhone(_user->phone());
crl::on_main(this, [=] {
using Flag = Data::PeerUpdate::Flag;
changes().peerUpdates(
@@ -83,8 +86,16 @@ Session::Session(
| Flag::Photo
| Flag::About
| Flag::PhoneNumber
) | rpl::start_with_next([=] {
) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
local().writeSelf();
if (update.flags & Flag::PhoneNumber) {
const auto phone = _user->phone();
_api->instance()->setUserPhone(phone);
if (!phone.isEmpty()) {
_api->instance()->requestConfig();
}
}
}, _lifetime);
if (_settings.hadLegacyCallsPeerToPeerNobody()) {