mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Allow kicking from confcall by creator.
This commit is contained in:
parent
d50fad615f
commit
909bd3dd2d
4 changed files with 16 additions and 5 deletions
|
@ -4960,6 +4960,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_confcall_invite_kicked_many#other" = "**{count} people** were removed from the call.";
|
"lng_confcall_invite_kicked_many#other" = "**{count} people** were removed from the call.";
|
||||||
"lng_confcall_not_accessible" = "This call is no longer accessible.";
|
"lng_confcall_not_accessible" = "This call is no longer accessible.";
|
||||||
"lng_confcall_participants_limit" = "This call reached the participants limit.";
|
"lng_confcall_participants_limit" = "This call reached the participants limit.";
|
||||||
|
"lng_confcall_sure_remove" = "Remove {user} from the call?";
|
||||||
|
|
||||||
"lng_no_mic_permission" = "Telegram needs microphone access so that you can make calls and record voice messages.";
|
"lng_no_mic_permission" = "Telegram needs microphone access so that you can make calls and record voice messages.";
|
||||||
|
|
||||||
|
|
|
@ -1645,7 +1645,8 @@ void GroupCall::sendJoinRequest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
hangup();
|
hangup();
|
||||||
Ui::Toast::Show((type == u"GROUPCALL_FORBIDDEN"_q)
|
Ui::Toast::Show((type == u"GROUPCALL_FORBIDDEN"_q
|
||||||
|
|| type == u"GROUPCALL_INVALID"_q)
|
||||||
? tr::lng_confcall_not_accessible(tr::now)
|
? tr::lng_confcall_not_accessible(tr::now)
|
||||||
: type);
|
: type);
|
||||||
}).send();
|
}).send();
|
||||||
|
|
|
@ -1481,11 +1481,12 @@ base::unique_qptr<Ui::PopupMenu> Members::Controller::createRowContextMenu(
|
||||||
removeHand);
|
removeHand);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
const auto invited = (muteState == Row::State::Invited)
|
||||||
|
|| (muteState == Row::State::Calling);
|
||||||
const auto conference = _call->conferenceCall().get();
|
const auto conference = _call->conferenceCall().get();
|
||||||
if (conference
|
if (conference
|
||||||
&& participantPeer->isUser()
|
&& participantPeer->isUser()
|
||||||
&& (muteState == Row::State::Invited
|
&& invited) {
|
||||||
|| muteState == Row::State::Calling)) {
|
|
||||||
const auto id = conference->id();
|
const auto id = conference->id();
|
||||||
const auto cancelInvite = [=](bool discard) {
|
const auto cancelInvite = [=](bool discard) {
|
||||||
Core::App().calls().declineOutgoingConferenceInvite(
|
Core::App().calls().declineOutgoingConferenceInvite(
|
||||||
|
@ -1521,6 +1522,8 @@ base::unique_qptr<Ui::PopupMenu> Members::Controller::createRowContextMenu(
|
||||||
|| muteState == Row::State::Calling
|
|| muteState == Row::State::Calling
|
||||||
|| muteState == Row::State::WithAccess) {
|
|| muteState == Row::State::WithAccess) {
|
||||||
return false;
|
return false;
|
||||||
|
} else if (conference && _call->canManage()) {
|
||||||
|
return true;
|
||||||
} else if (const auto chat = _peer->asChat()) {
|
} else if (const auto chat = _peer->asChat()) {
|
||||||
return chat->amCreator()
|
return chat->amCreator()
|
||||||
|| (user
|
|| (user
|
||||||
|
|
|
@ -1599,7 +1599,9 @@ void Panel::kickParticipant(not_null<PeerData*> participantPeer) {
|
||||||
tr::now,
|
tr::now,
|
||||||
lt_channel,
|
lt_channel,
|
||||||
participantPeer->name())
|
participantPeer->name())
|
||||||
: (_peer->isBroadcast()
|
: (_call->conference()
|
||||||
|
? tr::lng_confcall_sure_remove
|
||||||
|
: _peer->isBroadcast()
|
||||||
? tr::lng_profile_sure_kick_channel
|
? tr::lng_profile_sure_kick_channel
|
||||||
: tr::lng_profile_sure_kick)(
|
: tr::lng_profile_sure_kick)(
|
||||||
tr::now,
|
tr::now,
|
||||||
|
@ -1660,7 +1662,11 @@ bool Panel::isLayerShown() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Panel::kickParticipantSure(not_null<PeerData*> participantPeer) {
|
void Panel::kickParticipantSure(not_null<PeerData*> participantPeer) {
|
||||||
if (const auto chat = _peer->asChat()) {
|
if (_call->conference()) {
|
||||||
|
if (const auto user = participantPeer->asUser()) {
|
||||||
|
_call->removeConferenceParticipants({ peerToUser(user->id) });
|
||||||
|
}
|
||||||
|
} else if (const auto chat = _peer->asChat()) {
|
||||||
chat->session().api().chatParticipants().kick(chat, participantPeer);
|
chat->session().api().chatParticipants().kick(chat, participantPeer);
|
||||||
} else if (const auto channel = _peer->asChannel()) {
|
} else if (const auto channel = _peer->asChannel()) {
|
||||||
const auto currentRestrictedRights = [&] {
|
const auto currentRestrictedRights = [&] {
|
||||||
|
|
Loading…
Add table
Reference in a new issue