diff --git a/Telegram/SourceFiles/calls/calls_instance.cpp b/Telegram/SourceFiles/calls/calls_instance.cpp index b69f84f42..69e314f33 100644 --- a/Telegram/SourceFiles/calls/calls_instance.cpp +++ b/Telegram/SourceFiles/calls/calls_instance.cpp @@ -202,14 +202,15 @@ void Instance::startOutgoingCall(not_null user, bool video) { } void Instance::startOrJoinGroupCall( + std::shared_ptr show, not_null peer, const StartGroupCallArgs &args) { using JoinConfirm = StartGroupCallArgs::JoinConfirm; if (args.rtmpNeeded) { _startWithRtmp->start(peer, [=](object_ptr box) { - Ui::show(std::move(box), Ui::LayerOption::KeepOther); + show->showBox(std::move(box), Ui::LayerOption::KeepOther); }, [=](QString text) { - Ui::Toast::Show(text); + Ui::Toast::Show(show->toastParent(), text); }, [=](Group::JoinInfo info) { createGroupCall( std::move(info), @@ -225,9 +226,9 @@ void Instance::startOrJoinGroupCall( ? Group::ChooseJoinAsProcess::Context::CreateScheduled : Group::ChooseJoinAsProcess::Context::Create; _chooseJoinAs->start(peer, context, [=](object_ptr box) { - Ui::show(std::move(box), Ui::LayerOption::KeepOther); + show->showBox(std::move(box), Ui::LayerOption::KeepOther); }, [=](QString text) { - Ui::Toast::Show(text); + Ui::Toast::Show(show->toastParent(), text); }, [=](Group::JoinInfo info) { const auto call = info.peer->groupCall(); info.joinHash = args.joinHash; diff --git a/Telegram/SourceFiles/calls/calls_instance.h b/Telegram/SourceFiles/calls/calls_instance.h index 7bfe56970..1bdfaa618 100644 --- a/Telegram/SourceFiles/calls/calls_instance.h +++ b/Telegram/SourceFiles/calls/calls_instance.h @@ -25,6 +25,10 @@ namespace Main { class Session; } // namespace Main +namespace Ui { +class Show; +} // namespace Ui + namespace Calls::Group { struct JoinInfo; class Panel; @@ -64,6 +68,7 @@ public: void startOutgoingCall(not_null user, bool video); void startOrJoinGroupCall( + std::shared_ptr show, not_null peer, const StartGroupCallArgs &args); void handleUpdate( diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 5ced17ff1..81680f9e1 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -1265,7 +1265,10 @@ void SessionController::startOrJoinGroupCall( if (now == peer) { calls.activateCurrentCall(args.joinHash); } else if (calls.currentGroupCall()->scheduleDate()) { - calls.startOrJoinGroupCall(peer, { args.joinHash }); + calls.startOrJoinGroupCall( + std::make_shared(this), + peer, + {args.joinHash}); } else { askConfirmation( ((peer->isBroadcast() && now->isBroadcast()) @@ -1278,7 +1281,10 @@ void SessionController::startOrJoinGroupCall( tr::lng_group_call_leave(tr::now)); } } else { - calls.startOrJoinGroupCall(peer, args); + calls.startOrJoinGroupCall( + std::make_shared(this), + peer, + args); } }