2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Fix RTMP livestream starting while in another call.

Fixes #24862.
This commit is contained in:
John Preston
2022-08-08 16:39:44 +03:00
parent 068eb3fcd1
commit 3a3341fef8
5 changed files with 41 additions and 35 deletions

View File

@@ -202,23 +202,11 @@ void Instance::startOutgoingCall(not_null<UserData*> user, bool video) {
}), video);
}
void Instance::startOrJoinGroupCall(
void Instance::showStartOrJoinGroupCall(
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) {
show->showBox(std::move(box), Ui::LayerOption::KeepOther);
}, [=](QString text) {
Ui::Toast::Show(show->toastParent(), text);
}, [=](Group::JoinInfo info) {
createGroupCall(
std::move(info),
MTP_inputGroupCall(MTPlong(), MTPlong()));
});
return;
}
const auto context = (args.confirm == JoinConfirm::Always)
? Group::ChooseJoinAsProcess::Context::JoinWithConfirm
: peer->groupCall()
@@ -238,7 +226,19 @@ void Instance::startOrJoinGroupCall(
}
createGroupCall(
std::move(info),
call ? call->input() : MTP_inputGroupCall(MTPlong(), MTPlong()));
call ? call->input() : MTP_inputGroupCall({}, {}));
});
}
void Instance::showStartWithRtmp(
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer) {
_startWithRtmp->start(peer, [=](object_ptr<Ui::BoxContent> box) {
show->showBox(std::move(box), Ui::LayerOption::KeepOther);
}, [=](QString text) {
Ui::Toast::Show(show->toastParent(), text);
}, [=](Group::JoinInfo info) {
createGroupCall(std::move(info), MTP_inputGroupCall({}, {}));
});
}