Fix group call create box window.

This commit is contained in:
John Preston 2022-06-08 15:21:13 +04:00
parent 7828288660
commit 2b21ec3299
3 changed files with 18 additions and 6 deletions

View file

@ -202,14 +202,15 @@ void Instance::startOutgoingCall(not_null<UserData*> user, bool video) {
}
void Instance::startOrJoinGroupCall(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer,
const StartGroupCallArgs &args) {
using JoinConfirm = StartGroupCallArgs::JoinConfirm;
if (args.rtmpNeeded) {
_startWithRtmp->start(peer, [=](object_ptr<Ui::BoxContent> 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<Ui::BoxContent> 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;

View file

@ -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<UserData*> user, bool video);
void startOrJoinGroupCall(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer,
const StartGroupCallArgs &args);
void handleUpdate(

View file

@ -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<Show>(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<Show>(this),
peer,
args);
}
}