2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +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

@@ -7,9 +7,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "core/changelogs.h"
#include "storage/storage_account.h"
#include "lang/lang_keys.h"
#include "core/application.h"
#include "main/main_accounts.h"
#include "main/main_session.h"
#include "storage/storage_accounts.h"
#include "data/data_session.h"
#include "mainwindow.h"
#include "apiwrap.h"
@@ -80,7 +82,9 @@ Changelogs::Changelogs(not_null<Main::Session*> session, int oldVersion)
std::unique_ptr<Changelogs> Changelogs::Create(
not_null<Main::Session*> session) {
const auto oldVersion = session->local().oldMapVersion();
auto &local = Core::App().accounts().local();
const auto oldVersion = local.oldVersion();
local.clearOldVersion();
return (oldVersion > 0 && oldVersion < AppVersion)
? std::make_unique<Changelogs>(session, oldVersion)
: nullptr;