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

Fix new window crash for unavailable channels.

This commit is contained in:
John Preston
2022-06-22 15:30:56 +04:00
parent e2624416af
commit d81c40f4c8
6 changed files with 32 additions and 12 deletions

View File

@@ -1220,6 +1220,11 @@ void SessionController::closeThirdSection() {
}
}
bool SessionController::canShowSeparateWindow(
not_null<PeerData*> peer) const {
return peer->computeUnavailableReason().isEmpty();
}
void SessionController::showPeer(not_null<PeerData*> peer, MsgId msgId) {
const auto currentPeer = activeChatCurrent().peer();
if (peer && peer->isChannel() && currentPeer != peer) {