diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index d3a4b9732..8823ce1ab 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1826,6 +1826,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "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_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_settings_title" = "Settings"; "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_speakers" = "Speakers"; "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_recording" = "Stop Recording"; "lng_group_call_ptt_delay_ms" = "{amount} ms"; diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index 0741b2e29..6e612a293 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -223,10 +223,19 @@ void TopBarWidget::groupCall() { if (const auto megagroup = peer->asMegagroup()) { _controller->startOrJoinGroupCall(megagroup); } else if (const auto chat = peer->asChat()) { - const auto start = [=](not_null megagroup) { - _controller->startOrJoinGroupCall(megagroup); + const auto callback = [=] { + Ui::hideLayer(); + const auto start = [=](not_null 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( + 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()) { _rightTaken += _infoToggle->width() + st::topBarSkip; } - _search->moveToRight(_rightTaken, otherButtonsTop); - _rightTaken += _search->width() + st::topBarCallSkip; _call->moveToRight(_rightTaken, otherButtonsTop); _groupCall->moveToRight(_rightTaken, otherButtonsTop); _rightTaken += _call->width(); + _search->moveToRight(_rightTaken, otherButtonsTop); + _rightTaken += _search->width() + st::topBarCallSkip; updateMembersShowArea(); } @@ -717,8 +726,7 @@ void TopBarWidget::updateControlsVisibility() { const auto callsEnabled = [&] { if (const auto peer = _activeChat.key.peer()) { if (const auto user = peer->asUser()) { - return session().serverConfig().phoneCallsEnabled.current() - && user->hasCalls(); + return true; } } return false; diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 27eb8fc10..b1a3daf8d 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -961,6 +961,10 @@ void SessionController::startOrJoinGroupCall( tr::lng_group_call_leave_to_other_sure(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 { calls.startOrJoinGroupCall(megagroup); }