mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 07:56:03 +00:00
Fix couple of crashes.
This commit is contained in:
@@ -1457,8 +1457,6 @@ void ParticipantsBoxController::rowActionClicked(
|
|||||||
base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
not_null<PeerListRow*> row) {
|
not_null<PeerListRow*> row) {
|
||||||
Expects(row->peer()->isUser());
|
|
||||||
|
|
||||||
const auto chat = _peer->asChat();
|
const auto chat = _peer->asChat();
|
||||||
const auto channel = _peer->asChannel();
|
const auto channel = _peer->asChannel();
|
||||||
const auto participant = row->peer();
|
const auto participant = row->peer();
|
||||||
@@ -1466,7 +1464,11 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
|||||||
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
|
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
|
||||||
if (_navigation) {
|
if (_navigation) {
|
||||||
result->addAction(
|
result->addAction(
|
||||||
tr::lng_context_view_profile(tr::now),
|
(participant->isUser()
|
||||||
|
? tr::lng_context_view_profile
|
||||||
|
: participant->isBroadcast()
|
||||||
|
? tr::lng_context_view_channel
|
||||||
|
: tr::lng_context_view_group)(tr::now),
|
||||||
crl::guard(this, [=] {
|
crl::guard(this, [=] {
|
||||||
_navigation->showPeerInfo(participant); }));
|
_navigation->showPeerInfo(participant); }));
|
||||||
}
|
}
|
||||||
@@ -1493,7 +1495,7 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
|||||||
: tr::lng_context_promote_admin)(tr::now),
|
: tr::lng_context_promote_admin)(tr::now),
|
||||||
crl::guard(this, [=] { showAdmin(user); }));
|
crl::guard(this, [=] { showAdmin(user); }));
|
||||||
}
|
}
|
||||||
if (_additional.canRestrictParticipant(participant)) {
|
if (user && _additional.canRestrictParticipant(participant)) {
|
||||||
const auto canRestrictWithoutKick = [&] {
|
const auto canRestrictWithoutKick = [&] {
|
||||||
if (const auto chat = _peer->asChat()) {
|
if (const auto chat = _peer->asChat()) {
|
||||||
return chat->amCreator();
|
return chat->amCreator();
|
||||||
@@ -1506,7 +1508,7 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
|||||||
crl::guard(this, [=] { showRestricted(user); }));
|
crl::guard(this, [=] { showRestricted(user); }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_additional.canRemoveParticipant(participant)) {
|
if (user && _additional.canRemoveParticipant(participant)) {
|
||||||
if (!_additional.isKicked(participant)) {
|
if (!_additional.isKicked(participant)) {
|
||||||
const auto isGroup = _peer->isChat() || _peer->isMegagroup();
|
const auto isGroup = _peer->isChat() || _peer->isMegagroup();
|
||||||
result->addAction(
|
result->addAction(
|
||||||
|
2
Telegram/ThirdParty/tgcalls
vendored
2
Telegram/ThirdParty/tgcalls
vendored
Submodule Telegram/ThirdParty/tgcalls updated: eded7cc540...4a9de89c61
Reference in New Issue
Block a user