mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 16:05:57 +00:00
Allow several accounts in Core::App.
This commit is contained in:
@@ -13,8 +13,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "mtproto/mtp_instance.h"
|
||||
#include "storage/localstorage.h"
|
||||
#include "core/application.h"
|
||||
#include "main/main_session.h"
|
||||
#include "main/main_account.h"
|
||||
#include "main/main_accounts.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
@@ -158,7 +158,10 @@ Language ParseLanguage(const MTPLangPackLanguage &data) {
|
||||
|
||||
CloudManager::CloudManager(Instance &langpack)
|
||||
: _langpack(langpack) {
|
||||
Core::App().activeAccount().mtpValue( // #TODO multi activeAccountValue
|
||||
Core::App().accounts().activeValue(
|
||||
) | rpl::map([=](Main::Account *account) {
|
||||
return account ? account->mtpValue() : rpl::never<MTP::Instance*>();
|
||||
}) | rpl::flatten_latest(
|
||||
) | rpl::start_with_next([=](MTP::Instance *instance) {
|
||||
if (instance) {
|
||||
_api.emplace(instance);
|
||||
|
Reference in New Issue
Block a user