Added ability to schedule live stream without "Join As" choosing.

This commit is contained in:
23rd 2022-02-26 08:07:20 +03:00
parent 166d844d55
commit 97dbb98862
3 changed files with 14 additions and 2 deletions

View file

@ -206,6 +206,8 @@ void Instance::startOrJoinGroupCall(
? Group::ChooseJoinAsProcess::Context::JoinWithConfirm ? Group::ChooseJoinAsProcess::Context::JoinWithConfirm
: peer->groupCall() : peer->groupCall()
? Group::ChooseJoinAsProcess::Context::Join ? Group::ChooseJoinAsProcess::Context::Join
: args.scheduleNeeded
? Group::ChooseJoinAsProcess::Context::CreateScheduled
: Group::ChooseJoinAsProcess::Context::Create; : Group::ChooseJoinAsProcess::Context::Create;
_chooseJoinAs->start(peer, context, [=](object_ptr<Ui::BoxContent> box) { _chooseJoinAs->start(peer, context, [=](object_ptr<Ui::BoxContent> box) {
Ui::show(std::move(box), Ui::LayerOption::KeepOther); Ui::show(std::move(box), Ui::LayerOption::KeepOther);

View file

@ -243,7 +243,7 @@ void ChooseJoinAsBox(
auto next = (context == Context::Switch) auto next = (context == Context::Switch)
? tr::lng_settings_save() ? tr::lng_settings_save()
: tr::lng_continue(); : tr::lng_continue();
if (context == Context::Create) { if ((context == Context::Create) && !livestream) {
const auto makeLink = [](const QString &text) { const auto makeLink = [](const QString &text) {
return Ui::Text::Link(text); return Ui::Text::Link(text);
}; };
@ -346,7 +346,16 @@ void ChooseJoinAsProcess::start(
_request = nullptr; _request = nullptr;
}, _request->lifetime); }, _request->lifetime);
requestList(); if (context == Context::CreateScheduled) {
auto box = Box(
ScheduleGroupCallBox,
JoinInfo{ .peer = peer, .joinAs = peer },
[=](auto info) { finish(info); });
_request->box = Ui::MakeWeak(box.data());
showBox(std::move(box));
} else {
requestList();
}
} }
void ChooseJoinAsProcess::requestList() { void ChooseJoinAsProcess::requestList() {

View file

@ -27,6 +27,7 @@ public:
enum class Context { enum class Context {
Create, Create,
CreateScheduled,
Join, Join,
JoinWithConfirm, JoinWithConfirm,
Switch, Switch,