2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Allow opening new account in a separate window.

This commit is contained in:
John Preston
2023-01-27 19:56:43 +04:00
parent 42a2f53a11
commit e10964a0bc
6 changed files with 51 additions and 24 deletions

View File

@@ -1294,7 +1294,7 @@ bool MainWidget::showHistoryInDifferentWindow(
return true;
}
void MainWidget::showPeerHistory(
void MainWidget::showHistory(
PeerId peerId,
const SectionShow &params,
MsgId showAtMsgId) {
@@ -1311,6 +1311,7 @@ void MainWidget::showPeerHistory(
Assert(isPrimary());
if (params.activation != anim::activation::background) {
_controller->show(Ui::MakeInformBox(unavailable));
_controller->window().activate();
}
return;
}
@@ -1324,9 +1325,13 @@ void MainWidget::showPeerHistory(
return;
}
if (peerId && params.activation != anim::activation::background) {
_controller->window().activate();
}
if (!(_history->peer() && _history->peer()->id == peerId)
&& preventsCloseSection(
[=] { showPeerHistory(peerId, params, showAtMsgId); },
[=] { showHistory(peerId, params, showAtMsgId); },
params)) {
return;
}
@@ -1490,7 +1495,7 @@ void MainWidget::showMessage(
return;
}
} else if (_history->peer() == item->history()->peer) {
showPeerHistory(peerId, params, itemId);
showHistory(peerId, params, itemId);
return;
}
}