mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Added ability to schedule live stream without "Join As" choosing.
This commit is contained in:
parent
166d844d55
commit
97dbb98862
3 changed files with 14 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
|
||||
enum class Context {
|
||||
Create,
|
||||
CreateScheduled,
|
||||
Join,
|
||||
JoinWithConfirm,
|
||||
Switch,
|
||||
|
|
Loading…
Add table
Reference in a new issue