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
: peer->groupCall()
? Group::ChooseJoinAsProcess::Context::Join
: args.scheduleNeeded
? 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);

View File

@ -243,7 +243,7 @@ void ChooseJoinAsBox(
auto next = (context == Context::Switch)
? tr::lng_settings_save()
: tr::lng_continue();
if (context == Context::Create) {
if ((context == Context::Create) && !livestream) {
const auto makeLink = [](const QString &text) {
return Ui::Text::Link(text);
};
@ -346,7 +346,16 @@ void ChooseJoinAsProcess::start(
_request = nullptr;
}, _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() {

View File

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