Activate account before showing a peer.

This commit is contained in:
John Preston
2020-06-24 12:28:46 +04:00
parent 99bf61ac8c
commit e38d39656d
2 changed files with 38 additions and 19 deletions

View File

@@ -9,6 +9,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <rpl/combine.h>
#include "main/main_session.h"
#include "main/main_domain.h"
#include "core/application.h"
#include "apiwrap.h"
#include "storage/storage_facade.h"
#include "storage/storage_shared_media.h"
@@ -47,7 +49,14 @@ void SharedMediaShowOverview(
Storage::SharedMediaType type,
not_null<History*> history) {
if (SharedMediaOverviewType(type)) {
App::wnd()->sessionController()->showSection(Info::Memento(
const auto &windows = history->session().windows();
if (windows.empty()) {
Core::App().domain().activate(&history->session().account());
if (windows.empty()) {
return;
}
}
windows.front()->showSection(Info::Memento(
history->peer,
Info::Section(type)));
}