mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix account activation from main menu.
This commit is contained in:
parent
b48dee0af7
commit
e61c058eb5
2 changed files with 9 additions and 9 deletions
|
@ -79,6 +79,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "boxes/download_path_box.h"
|
||||
#include "boxes/connection_box.h"
|
||||
#include "storage/storage_account.h"
|
||||
#include "main/main_domain.h"
|
||||
#include "media/audio/media_audio.h"
|
||||
#include "media/player/media_player_panel.h"
|
||||
#include "media/player/media_player_widget.h"
|
||||
|
@ -1265,6 +1266,8 @@ bool MainWidget::showHistoryInDifferentWindow(
|
|||
const SectionShow ¶ms,
|
||||
MsgId showAtMsgId) {
|
||||
const auto peer = session().data().peer(peerId);
|
||||
const auto account = &session().account();
|
||||
auto primary = Core::App().separateWindowForAccount(account);
|
||||
if (const auto separate = Core::App().separateWindowForPeer(peer)) {
|
||||
if (separate == &_controller->window()) {
|
||||
return false;
|
||||
|
@ -1276,8 +1279,6 @@ bool MainWidget::showHistoryInDifferentWindow(
|
|||
separate->activate();
|
||||
return true;
|
||||
} else if (isPrimary()) {
|
||||
const auto primary = Core::App().separateWindowForAccount(
|
||||
&peer->account());
|
||||
if (primary && primary != &_controller->window()) {
|
||||
primary->sessionController()->showPeerHistory(
|
||||
peerId,
|
||||
|
@ -1291,18 +1292,17 @@ bool MainWidget::showHistoryInDifferentWindow(
|
|||
return true;
|
||||
} else if (singlePeer()->id == peerId) {
|
||||
return false;
|
||||
} else if (!primary) {
|
||||
Core::App().domain().activate(account);
|
||||
primary = Core::App().separateWindowForAccount(account);
|
||||
}
|
||||
const auto primary = Core::App().activePrimaryWindow();
|
||||
if (&primary->account() != &session().account()) {
|
||||
primary->showAccount(&session().account());
|
||||
}
|
||||
if (&primary->account() == &session().account()) {
|
||||
if (primary && &primary->account() == account) {
|
||||
primary->sessionController()->showPeerHistory(
|
||||
peerId,
|
||||
params,
|
||||
showAtMsgId);
|
||||
primary->activate();
|
||||
}
|
||||
primary->activate();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -689,7 +689,7 @@ void SetupAccountsWrap(
|
|||
|
||||
if (!locked) {
|
||||
addAction(tr::lng_menu_activate(tr::now), [=] {
|
||||
Core::App().domain().activate(&session->account());
|
||||
callback({});
|
||||
}, &st::menuIconProfile);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue