2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 23:25:15 +00:00

Moved opening peer from PeerClickHandler to SessionController.

This commit is contained in:
23rd
2021-10-07 19:16:42 +03:00
parent 51b259fdea
commit d8fb5be9b5
4 changed files with 47 additions and 28 deletions

View File

@@ -1074,6 +1074,30 @@ void SessionController::closeThirdSection() {
}
}
void SessionController::showPeer(not_null<PeerData*> peer, MsgId msgId) {
const auto currentPeer = activeChatCurrent().peer();
if (peer && peer->isChannel() && currentPeer != peer) {
const auto clickedChannel = peer->asChannel();
if (!clickedChannel->isPublic()
&& !clickedChannel->amIn()
&& (!currentPeer->isChannel()
|| currentPeer->asChannel()->linkedChat()
!= clickedChannel)) {
Ui::ShowMultilineToast({
.text = {
.text = peer->isMegagroup()
? tr::lng_group_not_accessible(tr::now)
: tr::lng_channel_not_accessible(tr::now)
},
});
} else {
showPeerHistory(peer->id, SectionShow(), msgId);
}
} else {
showPeerInfo(peer, SectionShow());
}
}
void SessionController::startOrJoinGroupCall(
not_null<PeerData*> peer,
QString joinHash,