mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Create voice chats with confirmation.
This commit is contained in:
parent
d15a5c9bdc
commit
7feb841081
3 changed files with 21 additions and 8 deletions
|
@ -1826,6 +1826,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_group_call_leave_title" = "Leave voice chat";
|
"lng_group_call_leave_title" = "Leave voice chat";
|
||||||
"lng_group_call_leave_sure" = "Are you sure you want to leave this voice chat?";
|
"lng_group_call_leave_sure" = "Are you sure you want to leave this voice chat?";
|
||||||
"lng_group_call_leave_to_other_sure" = "Do you want to leave your active voice chat and join a voice chat in this group?";
|
"lng_group_call_leave_to_other_sure" = "Do you want to leave your active voice chat and join a voice chat in this group?";
|
||||||
|
"lng_group_call_create_sure" = "Do you really want to start a voice chat in this group?";
|
||||||
"lng_group_call_also_end" = "End voice chat";
|
"lng_group_call_also_end" = "End voice chat";
|
||||||
"lng_group_call_settings_title" = "Settings";
|
"lng_group_call_settings_title" = "Settings";
|
||||||
"lng_group_call_invite_title" = "Invite members";
|
"lng_group_call_invite_title" = "Invite members";
|
||||||
|
@ -1833,7 +1834,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_group_call_new_muted" = "Mute new members";
|
"lng_group_call_new_muted" = "Mute new members";
|
||||||
"lng_group_call_speakers" = "Speakers";
|
"lng_group_call_speakers" = "Speakers";
|
||||||
"lng_group_call_microphone" = "Microphone";
|
"lng_group_call_microphone" = "Microphone";
|
||||||
"lng_group_call_push_to_talk" = "Push to Talk";
|
"lng_group_call_push_to_talk" = "Push to Talk Shortcut";
|
||||||
"lng_group_call_ptt_shortcut" = "Edit Shortcut";
|
"lng_group_call_ptt_shortcut" = "Edit Shortcut";
|
||||||
"lng_group_call_ptt_recording" = "Stop Recording";
|
"lng_group_call_ptt_recording" = "Stop Recording";
|
||||||
"lng_group_call_ptt_delay_ms" = "{amount} ms";
|
"lng_group_call_ptt_delay_ms" = "{amount} ms";
|
||||||
|
|
|
@ -223,10 +223,19 @@ void TopBarWidget::groupCall() {
|
||||||
if (const auto megagroup = peer->asMegagroup()) {
|
if (const auto megagroup = peer->asMegagroup()) {
|
||||||
_controller->startOrJoinGroupCall(megagroup);
|
_controller->startOrJoinGroupCall(megagroup);
|
||||||
} else if (const auto chat = peer->asChat()) {
|
} else if (const auto chat = peer->asChat()) {
|
||||||
const auto start = [=](not_null<ChannelData*> megagroup) {
|
const auto callback = [=] {
|
||||||
_controller->startOrJoinGroupCall(megagroup);
|
Ui::hideLayer();
|
||||||
|
const auto start = [=](not_null<ChannelData*> megagroup) {
|
||||||
|
_controller->startOrJoinGroupCall(megagroup, true);
|
||||||
|
};
|
||||||
|
peer->session().api().migrateChat(
|
||||||
|
chat,
|
||||||
|
crl::guard(this, start));
|
||||||
};
|
};
|
||||||
peer->session().api().migrateChat(chat, crl::guard(this, start));
|
Ui::show(Box<ConfirmBox>(
|
||||||
|
tr::lng_group_call_create_sure(tr::now),
|
||||||
|
tr::lng_continue(tr::now),
|
||||||
|
crl::guard(this, callback)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -655,11 +664,11 @@ void TopBarWidget::updateControlsGeometry() {
|
||||||
if (!_infoToggle->isHidden()) {
|
if (!_infoToggle->isHidden()) {
|
||||||
_rightTaken += _infoToggle->width() + st::topBarSkip;
|
_rightTaken += _infoToggle->width() + st::topBarSkip;
|
||||||
}
|
}
|
||||||
_search->moveToRight(_rightTaken, otherButtonsTop);
|
|
||||||
_rightTaken += _search->width() + st::topBarCallSkip;
|
|
||||||
_call->moveToRight(_rightTaken, otherButtonsTop);
|
_call->moveToRight(_rightTaken, otherButtonsTop);
|
||||||
_groupCall->moveToRight(_rightTaken, otherButtonsTop);
|
_groupCall->moveToRight(_rightTaken, otherButtonsTop);
|
||||||
_rightTaken += _call->width();
|
_rightTaken += _call->width();
|
||||||
|
_search->moveToRight(_rightTaken, otherButtonsTop);
|
||||||
|
_rightTaken += _search->width() + st::topBarCallSkip;
|
||||||
|
|
||||||
updateMembersShowArea();
|
updateMembersShowArea();
|
||||||
}
|
}
|
||||||
|
@ -717,8 +726,7 @@ void TopBarWidget::updateControlsVisibility() {
|
||||||
const auto callsEnabled = [&] {
|
const auto callsEnabled = [&] {
|
||||||
if (const auto peer = _activeChat.key.peer()) {
|
if (const auto peer = _activeChat.key.peer()) {
|
||||||
if (const auto user = peer->asUser()) {
|
if (const auto user = peer->asUser()) {
|
||||||
return session().serverConfig().phoneCallsEnabled.current()
|
return true;
|
||||||
&& user->hasCalls();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -961,6 +961,10 @@ void SessionController::startOrJoinGroupCall(
|
||||||
tr::lng_group_call_leave_to_other_sure(tr::now),
|
tr::lng_group_call_leave_to_other_sure(tr::now),
|
||||||
tr::lng_group_call_leave(tr::now));
|
tr::lng_group_call_leave(tr::now));
|
||||||
}
|
}
|
||||||
|
} else if (!confirmedLeaveOther && !megagroup->call()) {
|
||||||
|
confirm(
|
||||||
|
tr::lng_group_call_create_sure(tr::now),
|
||||||
|
tr::lng_continue(tr::now));
|
||||||
} else {
|
} else {
|
||||||
calls.startOrJoinGroupCall(megagroup);
|
calls.startOrJoinGroupCall(megagroup);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue