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:
@@ -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()) {
|
||||
|
Reference in New Issue
Block a user