mirror of https://github.com/procxx/kepka.git
Fix opening private linked channel from message
This commit is contained in:
parent
05eabfd539
commit
46de86f1e4
|
@ -85,10 +85,14 @@ PeerClickHandler::PeerClickHandler(not_null<PeerData*> peer)
|
|||
void PeerClickHandler::onClick(ClickContext context) const {
|
||||
if (context.button == Qt::LeftButton && App::wnd()) {
|
||||
const auto controller = App::wnd()->sessionController();
|
||||
const auto currentPeer = controller->activeChatCurrent().peer();
|
||||
if (_peer
|
||||
&& _peer->isChannel()
|
||||
&& controller->activeChatCurrent().peer() != _peer) {
|
||||
if (!_peer->asChannel()->isPublic() && !_peer->asChannel()->amIn()) {
|
||||
&& currentPeer != _peer) {
|
||||
const auto clickedChannel = _peer->asChannel();
|
||||
if (!clickedChannel->isPublic() && !clickedChannel->amIn()
|
||||
&& (!currentPeer->isChannel()
|
||||
|| currentPeer->asChannel()->linkedChat() != clickedChannel)) {
|
||||
Ui::show(Box<InformBox>(_peer->isMegagroup()
|
||||
? tr::lng_group_not_accessible(tr::now)
|
||||
: tr::lng_channel_not_accessible(tr::now)));
|
||||
|
|
Loading…
Reference in New Issue