mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Try migrating mute/video state.
This commit is contained in:
parent
6528567746
commit
eb06c0da08
9 changed files with 118 additions and 71 deletions
|
@ -437,20 +437,24 @@ void Call::acceptConferenceInvite() {
|
||||||
const auto limit = 5;
|
const auto limit = 5;
|
||||||
const auto messageId = _conferenceInviteMsgId;
|
const auto messageId = _conferenceInviteMsgId;
|
||||||
const auto session = &_user->session();
|
const auto session = &_user->session();
|
||||||
|
auto info = StartConferenceInfo{
|
||||||
|
.joinMessageId = messageId,
|
||||||
|
.migrating = true,
|
||||||
|
.muted = muted(),
|
||||||
|
.videoCapture = isSharingVideo() ? _videoCapture : nullptr,
|
||||||
|
.videoCaptureScreenId = screenSharingDeviceId(),
|
||||||
|
};
|
||||||
session->api().request(MTPphone_GetGroupCall(
|
session->api().request(MTPphone_GetGroupCall(
|
||||||
MTP_inputGroupCallInviteMessage(MTP_int(messageId.bare)),
|
MTP_inputGroupCallInviteMessage(MTP_int(messageId.bare)),
|
||||||
MTP_int(limit)
|
MTP_int(limit)
|
||||||
)).done([session, messageId](const MTPphone_GroupCall &result) {
|
)).done([session, messageId, info](const MTPphone_GroupCall &result) {
|
||||||
result.data().vcall().match([&](const auto &data) {
|
result.data().vcall().match([&](const auto &data) {
|
||||||
const auto call = session->data().sharedConferenceCall(
|
auto copy = info;
|
||||||
|
copy.call = session->data().sharedConferenceCall(
|
||||||
data.vid().v,
|
data.vid().v,
|
||||||
data.vaccess_hash().v);
|
data.vaccess_hash().v);
|
||||||
call->processFullCall(result);
|
copy.call->processFullCall(result);
|
||||||
Core::App().calls().startOrJoinConferenceCall({
|
Core::App().calls().startOrJoinConferenceCall(std::move(copy));
|
||||||
.call = call,
|
|
||||||
.joinMessageId = messageId,
|
|
||||||
.migrating = true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}).fail(crl::guard(this, [=](const MTP::Error &error) {
|
}).fail(crl::guard(this, [=](const MTP::Error &error) {
|
||||||
handleRequestError(error.type());
|
handleRequestError(error.type());
|
||||||
|
@ -561,7 +565,8 @@ void Call::setupOutgoingVideo() {
|
||||||
_videoOutgoing->setState(Webrtc::VideoState::Inactive);
|
_videoOutgoing->setState(Webrtc::VideoState::Inactive);
|
||||||
} else if (_state.current() != State::Established
|
} else if (_state.current() != State::Established
|
||||||
&& (state != Webrtc::VideoState::Inactive)
|
&& (state != Webrtc::VideoState::Inactive)
|
||||||
&& (started == Webrtc::VideoState::Inactive)) {
|
&& (started == Webrtc::VideoState::Inactive)
|
||||||
|
&& !conferenceInvite()) {
|
||||||
_errors.fire({ ErrorType::NotStartedCall });
|
_errors.fire({ ErrorType::NotStartedCall });
|
||||||
_videoOutgoing->setState(Webrtc::VideoState::Inactive);
|
_videoOutgoing->setState(Webrtc::VideoState::Inactive);
|
||||||
} else if (state != Webrtc::VideoState::Inactive
|
} else if (state != Webrtc::VideoState::Inactive
|
||||||
|
@ -1451,6 +1456,11 @@ void Call::toggleScreenSharing(std::optional<QString> uniqueId) {
|
||||||
_videoOutgoing->setState(Webrtc::VideoState::Active);
|
_videoOutgoing->setState(Webrtc::VideoState::Active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto Call::peekVideoCapture() const
|
||||||
|
-> std::shared_ptr<tgcalls::VideoCaptureInterface> {
|
||||||
|
return _videoCapture;
|
||||||
|
}
|
||||||
|
|
||||||
auto Call::playbackDeviceIdValue() const
|
auto Call::playbackDeviceIdValue() const
|
||||||
-> rpl::producer<Webrtc::DeviceResolvedId> {
|
-> rpl::producer<Webrtc::DeviceResolvedId> {
|
||||||
return _playbackDeviceId.value();
|
return _playbackDeviceId.value();
|
||||||
|
|
|
@ -247,6 +247,8 @@ public:
|
||||||
[[nodiscard]] QString screenSharingDeviceId() const;
|
[[nodiscard]] QString screenSharingDeviceId() const;
|
||||||
void toggleCameraSharing(bool enabled);
|
void toggleCameraSharing(bool enabled);
|
||||||
void toggleScreenSharing(std::optional<QString> uniqueId);
|
void toggleScreenSharing(std::optional<QString> uniqueId);
|
||||||
|
[[nodiscard]] auto peekVideoCapture() const
|
||||||
|
-> std::shared_ptr<tgcalls::VideoCaptureInterface>;
|
||||||
|
|
||||||
[[nodiscard]] auto playbackDeviceIdValue() const
|
[[nodiscard]] auto playbackDeviceIdValue() const
|
||||||
-> rpl::producer<Webrtc::DeviceResolvedId>;
|
-> rpl::producer<Webrtc::DeviceResolvedId>;
|
||||||
|
|
|
@ -235,20 +235,13 @@ void Instance::startOrJoinGroupCall(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instance::startOrJoinConferenceCall(StartConferenceCallArgs args) {
|
void Instance::startOrJoinConferenceCall(StartConferenceInfo args) {
|
||||||
destroyCurrentCall(
|
destroyCurrentCall(
|
||||||
args.migrating ? args.call.get() : nullptr,
|
args.migrating ? args.call.get() : nullptr,
|
||||||
args.migrating ? args.linkSlug : QString());
|
args.migrating ? args.linkSlug : QString());
|
||||||
|
|
||||||
const auto session = &args.call->peer()->session();
|
const auto session = &args.call->peer()->session();
|
||||||
auto call = std::make_unique<GroupCall>(
|
auto call = std::make_unique<GroupCall>(_delegate.get(), args);
|
||||||
_delegate.get(),
|
|
||||||
Calls::Group::ConferenceInfo{
|
|
||||||
.call = std::move(args.call),
|
|
||||||
.e2e = std::move(args.e2e),
|
|
||||||
.linkSlug = args.linkSlug,
|
|
||||||
.joinMessageId = args.joinMessageId,
|
|
||||||
});
|
|
||||||
const auto raw = call.get();
|
const auto raw = call.get();
|
||||||
|
|
||||||
session->account().sessionChanges(
|
session->account().sessionChanges(
|
||||||
|
|
|
@ -45,10 +45,6 @@ namespace tgcalls {
|
||||||
class VideoCaptureInterface;
|
class VideoCaptureInterface;
|
||||||
} // namespace tgcalls
|
} // namespace tgcalls
|
||||||
|
|
||||||
namespace TdE2E {
|
|
||||||
class Call;
|
|
||||||
} // namespace TdE2E
|
|
||||||
|
|
||||||
namespace Calls {
|
namespace Calls {
|
||||||
|
|
||||||
class Call;
|
class Call;
|
||||||
|
@ -57,6 +53,7 @@ class GroupCall;
|
||||||
class Panel;
|
class Panel;
|
||||||
struct DhConfig;
|
struct DhConfig;
|
||||||
struct InviteRequest;
|
struct InviteRequest;
|
||||||
|
struct StartConferenceInfo;
|
||||||
|
|
||||||
struct StartGroupCallArgs {
|
struct StartGroupCallArgs {
|
||||||
enum class JoinConfirm {
|
enum class JoinConfirm {
|
||||||
|
@ -69,15 +66,6 @@ struct StartGroupCallArgs {
|
||||||
bool scheduleNeeded = false;
|
bool scheduleNeeded = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StartConferenceCallArgs {
|
|
||||||
std::shared_ptr<Data::GroupCall> call;
|
|
||||||
std::shared_ptr<TdE2E::Call> e2e;
|
|
||||||
QString linkSlug;
|
|
||||||
MsgId joinMessageId;
|
|
||||||
std::vector<InviteRequest> invite;
|
|
||||||
bool migrating = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ConferenceInviteMessages {
|
struct ConferenceInviteMessages {
|
||||||
base::flat_set<MsgId> incoming;
|
base::flat_set<MsgId> incoming;
|
||||||
base::flat_set<MsgId> outgoing;
|
base::flat_set<MsgId> outgoing;
|
||||||
|
@ -97,7 +85,7 @@ public:
|
||||||
std::shared_ptr<Ui::Show> show,
|
std::shared_ptr<Ui::Show> show,
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
StartGroupCallArgs args);
|
StartGroupCallArgs args);
|
||||||
void startOrJoinConferenceCall(StartConferenceCallArgs args);
|
void startOrJoinConferenceCall(StartConferenceInfo args);
|
||||||
void showStartWithRtmp(
|
void showStartWithRtmp(
|
||||||
std::shared_ptr<Ui::Show> show,
|
std::shared_ptr<Ui::Show> show,
|
||||||
not_null<PeerData*> peer);
|
not_null<PeerData*> peer);
|
||||||
|
|
|
@ -477,9 +477,16 @@ void Panel::initControls() {
|
||||||
Group::MakeConferenceCall({
|
Group::MakeConferenceCall({
|
||||||
.show = uiShow(),
|
.show = uiShow(),
|
||||||
.finished = finish,
|
.finished = finish,
|
||||||
.invite = std::move(users),
|
|
||||||
.joining = true,
|
.joining = true,
|
||||||
.migrating = true,
|
.info = {
|
||||||
|
.invite = std::move(users),
|
||||||
|
.migrating = true,
|
||||||
|
.muted = call->muted(),
|
||||||
|
.videoCapture = (call->isSharingVideo()
|
||||||
|
? call->peekVideoCapture()
|
||||||
|
: nullptr),
|
||||||
|
.videoCaptureScreenId = call->screenSharingDeviceId(),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const auto invite = crl::guard(call, [=](
|
const auto invite = crl::guard(call, [=](
|
||||||
|
|
|
@ -58,13 +58,10 @@ constexpr auto kMaxMediumQualities = 16; // 4 Fulls or 16 Mediums.
|
||||||
constexpr auto kShortPollChainBlocksPerRequest = 50;
|
constexpr auto kShortPollChainBlocksPerRequest = 50;
|
||||||
|
|
||||||
[[nodiscard]] const Data::GroupCallParticipant *LookupParticipant(
|
[[nodiscard]] const Data::GroupCallParticipant *LookupParticipant(
|
||||||
not_null<PeerData*> peer,
|
not_null<GroupCall*> call,
|
||||||
CallId id,
|
|
||||||
not_null<PeerData*> participantPeer) {
|
not_null<PeerData*> participantPeer) {
|
||||||
const auto call = peer->groupCall();
|
const auto real = call->lookupReal();
|
||||||
return (id && call && call->id() == id)
|
return real ? real->participantByPeer(participantPeer) : nullptr;
|
||||||
? call->participantByPeer(participantPeer)
|
|
||||||
: nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] double TimestampFromMsgId(mtpMsgId msgId) {
|
[[nodiscard]] double TimestampFromMsgId(mtpMsgId msgId) {
|
||||||
|
@ -578,7 +575,7 @@ GroupCall::GroupCall(
|
||||||
|
|
||||||
GroupCall::GroupCall(
|
GroupCall::GroupCall(
|
||||||
not_null<Delegate*> delegate,
|
not_null<Delegate*> delegate,
|
||||||
Group::ConferenceInfo info)
|
StartConferenceInfo info)
|
||||||
: GroupCall(delegate, Group::JoinInfo{
|
: GroupCall(delegate, Group::JoinInfo{
|
||||||
.peer = info.call->peer(),
|
.peer = info.call->peer(),
|
||||||
.joinAs = info.call->peer(),
|
.joinAs = info.call->peer(),
|
||||||
|
@ -588,7 +585,7 @@ GroupCall::GroupCall(
|
||||||
GroupCall::GroupCall(
|
GroupCall::GroupCall(
|
||||||
not_null<Delegate*> delegate,
|
not_null<Delegate*> delegate,
|
||||||
Group::JoinInfo join,
|
Group::JoinInfo join,
|
||||||
Group::ConferenceInfo conference,
|
StartConferenceInfo conference,
|
||||||
const MTPInputGroupCall &inputCall)
|
const MTPInputGroupCall &inputCall)
|
||||||
: _delegate(delegate)
|
: _delegate(delegate)
|
||||||
, _conferenceCall(std::move(conference.call))
|
, _conferenceCall(std::move(conference.call))
|
||||||
|
@ -682,6 +679,13 @@ GroupCall::GroupCall(
|
||||||
setupOutgoingVideo();
|
setupOutgoingVideo();
|
||||||
if (_conferenceCall) {
|
if (_conferenceCall) {
|
||||||
setupConferenceCall();
|
setupConferenceCall();
|
||||||
|
if (conference.migrating) {
|
||||||
|
if (!conference.muted) {
|
||||||
|
setMuted(MuteState::Active);
|
||||||
|
}
|
||||||
|
_migratedConferenceInfo = std::make_shared<StartConferenceInfo>(
|
||||||
|
std::move(conference));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id) {
|
if (_id) {
|
||||||
|
@ -694,6 +698,40 @@ GroupCall::GroupCall(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GroupCall::processMigration(StartConferenceInfo conference) {
|
||||||
|
if (!conference.videoCapture) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto weak = base::make_weak(this);
|
||||||
|
if (!conference.videoCaptureScreenId.isEmpty()) {
|
||||||
|
_screenCapture = std::move(conference.videoCapture);
|
||||||
|
_screenDeviceId = conference.videoCaptureScreenId;
|
||||||
|
_screenCapture->setOnFatalError([=] {
|
||||||
|
crl::on_main(weak, [=] {
|
||||||
|
emitShareScreenError(Error::ScreenFailed);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
_screenCapture->setOnPause([=](bool paused) {
|
||||||
|
crl::on_main(weak, [=] {
|
||||||
|
if (isSharingScreen()) {
|
||||||
|
_screenState = paused
|
||||||
|
? Webrtc::VideoState::Paused
|
||||||
|
: Webrtc::VideoState::Active;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
_screenState = Webrtc::VideoState::Active;
|
||||||
|
} else {
|
||||||
|
_cameraCapture = std::move(conference.videoCapture);
|
||||||
|
_cameraCapture->setOnFatalError([=] {
|
||||||
|
crl::on_main(weak, [=] {
|
||||||
|
emitShareCameraError(Error::CameraFailed);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
_cameraState = Webrtc::VideoState::Active;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GroupCall::~GroupCall() {
|
GroupCall::~GroupCall() {
|
||||||
destroyScreencast();
|
destroyScreencast();
|
||||||
destroyController();
|
destroyController();
|
||||||
|
@ -1578,6 +1616,9 @@ void GroupCall::sendJoinRequest() {
|
||||||
sendOutboundBlock(base::take(_pendingOutboundBlock));
|
sendOutboundBlock(base::take(_pendingOutboundBlock));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (const auto once = base::take(_migratedConferenceInfo)) {
|
||||||
|
processMigration(*once);
|
||||||
|
}
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
const auto type = error.type();
|
const auto type = error.type();
|
||||||
if (_e2e) {
|
if (_e2e) {
|
||||||
|
@ -1885,7 +1926,7 @@ void GroupCall::applyParticipantLocally(
|
||||||
not_null<PeerData*> participantPeer,
|
not_null<PeerData*> participantPeer,
|
||||||
bool mute,
|
bool mute,
|
||||||
std::optional<int> volume) {
|
std::optional<int> volume) {
|
||||||
const auto participant = LookupParticipant(_peer, _id, participantPeer);
|
const auto participant = LookupParticipant(this, participantPeer);
|
||||||
if (!participant || !participant->ssrc) {
|
if (!participant || !participant->ssrc) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2370,7 +2411,7 @@ void GroupCall::applyOtherParticipantUpdate(
|
||||||
}
|
}
|
||||||
const auto participantPeer = _peer->owner().peer(
|
const auto participantPeer = _peer->owner().peer(
|
||||||
peerFromMTP(data.vpeer()));
|
peerFromMTP(data.vpeer()));
|
||||||
if (!LookupParticipant(_peer, _id, participantPeer)) {
|
if (!LookupParticipant(this, participantPeer)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_otherParticipantStateValue.fire(Group::ParticipantState{
|
_otherParticipantStateValue.fire(Group::ParticipantState{
|
||||||
|
@ -3686,7 +3727,7 @@ void GroupCall::editParticipant(
|
||||||
not_null<PeerData*> participantPeer,
|
not_null<PeerData*> participantPeer,
|
||||||
bool mute,
|
bool mute,
|
||||||
std::optional<int> volume) {
|
std::optional<int> volume) {
|
||||||
const auto participant = LookupParticipant(_peer, _id, participantPeer);
|
const auto participant = LookupParticipant(this, participantPeer);
|
||||||
if (!participant) {
|
if (!participant) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ enum class Error;
|
||||||
|
|
||||||
struct InviteRequest;
|
struct InviteRequest;
|
||||||
struct InviteResult;
|
struct InviteResult;
|
||||||
|
struct StartConferenceInfo;
|
||||||
|
|
||||||
enum class MuteState {
|
enum class MuteState {
|
||||||
Active,
|
Active,
|
||||||
|
@ -225,9 +226,7 @@ public:
|
||||||
not_null<Delegate*> delegate,
|
not_null<Delegate*> delegate,
|
||||||
Group::JoinInfo info,
|
Group::JoinInfo info,
|
||||||
const MTPInputGroupCall &inputCall);
|
const MTPInputGroupCall &inputCall);
|
||||||
GroupCall(
|
GroupCall(not_null<Delegate*> delegate, StartConferenceInfo info);
|
||||||
not_null<Delegate*> delegate,
|
|
||||||
Group::ConferenceInfo info);
|
|
||||||
~GroupCall();
|
~GroupCall();
|
||||||
|
|
||||||
[[nodiscard]] CallId id() const {
|
[[nodiscard]] CallId id() const {
|
||||||
|
@ -505,7 +504,7 @@ private:
|
||||||
GroupCall(
|
GroupCall(
|
||||||
not_null<Delegate*> delegate,
|
not_null<Delegate*> delegate,
|
||||||
Group::JoinInfo join,
|
Group::JoinInfo join,
|
||||||
Group::ConferenceInfo conference,
|
StartConferenceInfo conference,
|
||||||
const MTPInputGroupCall &inputCall);
|
const MTPInputGroupCall &inputCall);
|
||||||
|
|
||||||
void broadcastPartStart(std::shared_ptr<LoadPartTask> task);
|
void broadcastPartStart(std::shared_ptr<LoadPartTask> task);
|
||||||
|
@ -620,6 +619,8 @@ private:
|
||||||
void markTrackPaused(const VideoEndpoint &endpoint, bool paused);
|
void markTrackPaused(const VideoEndpoint &endpoint, bool paused);
|
||||||
void markTrackShown(const VideoEndpoint &endpoint, bool shown);
|
void markTrackShown(const VideoEndpoint &endpoint, bool shown);
|
||||||
|
|
||||||
|
void processMigration(StartConferenceInfo conference);
|
||||||
|
|
||||||
[[nodiscard]] int activeVideoSendersCount() const;
|
[[nodiscard]] int activeVideoSendersCount() const;
|
||||||
|
|
||||||
[[nodiscard]] MTPInputGroupCall inputCall() const;
|
[[nodiscard]] MTPInputGroupCall inputCall() const;
|
||||||
|
@ -629,6 +630,7 @@ private:
|
||||||
const std::shared_ptr<Data::GroupCall> _conferenceCall;
|
const std::shared_ptr<Data::GroupCall> _conferenceCall;
|
||||||
std::shared_ptr<TdE2E::Call> _e2e;
|
std::shared_ptr<TdE2E::Call> _e2e;
|
||||||
QByteArray _pendingOutboundBlock;
|
QByteArray _pendingOutboundBlock;
|
||||||
|
std::shared_ptr<StartConferenceInfo> _migratedConferenceInfo;
|
||||||
|
|
||||||
not_null<PeerData*> _peer; // Can change in legacy group migration.
|
not_null<PeerData*> _peer; // Can change in legacy group migration.
|
||||||
rpl::event_stream<PeerData*> _peerStream;
|
rpl::event_stream<PeerData*> _peerStream;
|
||||||
|
|
|
@ -392,7 +392,7 @@ void ExportConferenceCallLink(
|
||||||
std::shared_ptr<Data::GroupCall> call,
|
std::shared_ptr<Data::GroupCall> call,
|
||||||
ConferenceCallLinkArgs &&args) {
|
ConferenceCallLinkArgs &&args) {
|
||||||
const auto session = &show->session();
|
const auto session = &show->session();
|
||||||
const auto invite = std::move(args.invite);
|
const auto info = std::move(args.info);
|
||||||
const auto finished = std::move(args.finished);
|
const auto finished = std::move(args.finished);
|
||||||
|
|
||||||
using Flag = MTPphone_ExportGroupCallInvite::Flag;
|
using Flag = MTPphone_ExportGroupCallInvite::Flag;
|
||||||
|
@ -403,12 +403,10 @@ void ExportConferenceCallLink(
|
||||||
const auto link = qs(result.data().vlink());
|
const auto link = qs(result.data().vlink());
|
||||||
if (args.joining) {
|
if (args.joining) {
|
||||||
if (auto slug = ExtractConferenceSlug(link); !slug.isEmpty()) {
|
if (auto slug = ExtractConferenceSlug(link); !slug.isEmpty()) {
|
||||||
Core::App().calls().startOrJoinConferenceCall({
|
auto copy = info;
|
||||||
.call = call,
|
copy.call = call;
|
||||||
.linkSlug = std::move(slug),
|
copy.linkSlug = std::move(slug);
|
||||||
.invite = invite,
|
Core::App().calls().startOrJoinConferenceCall(info);
|
||||||
.migrating = args.migrating,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (const auto onstack = finished) {
|
if (const auto onstack = finished) {
|
||||||
finished(QString());
|
finished(QString());
|
||||||
|
@ -435,8 +433,7 @@ void MakeConferenceCall(ConferenceFactoryArgs &&args) {
|
||||||
const auto show = std::move(args.show);
|
const auto show = std::move(args.show);
|
||||||
const auto finished = std::move(args.finished);
|
const auto finished = std::move(args.finished);
|
||||||
const auto joining = args.joining;
|
const auto joining = args.joining;
|
||||||
const auto migrating = args.migrating;
|
const auto info = std::move(args.info);
|
||||||
const auto invite = std::move(args.invite);
|
|
||||||
const auto session = &show->session();
|
const auto session = &show->session();
|
||||||
session->api().request(MTPphone_CreateConferenceCall(
|
session->api().request(MTPphone_CreateConferenceCall(
|
||||||
MTP_int(base::RandomValue<int32>())
|
MTP_int(base::RandomValue<int32>())
|
||||||
|
@ -449,9 +446,8 @@ void MakeConferenceCall(ConferenceFactoryArgs &&args) {
|
||||||
Calls::Group::ExportConferenceCallLink(show, call, {
|
Calls::Group::ExportConferenceCallLink(show, call, {
|
||||||
.initial = true,
|
.initial = true,
|
||||||
.joining = joining,
|
.joining = joining,
|
||||||
.migrating = migrating,
|
|
||||||
.finished = finished,
|
.finished = finished,
|
||||||
.invite = invite,
|
.info = info,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
|
|
|
@ -37,6 +37,10 @@ namespace TdE2E {
|
||||||
class Call;
|
class Call;
|
||||||
} // namespace TdE2E
|
} // namespace TdE2E
|
||||||
|
|
||||||
|
namespace tgcalls {
|
||||||
|
class VideoCaptureInterface;
|
||||||
|
} // namespace tgcalls
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
class SessionController;
|
class SessionController;
|
||||||
} // namespace Window
|
} // namespace Window
|
||||||
|
@ -47,12 +51,25 @@ struct InviteRequest {
|
||||||
not_null<UserData*> user;
|
not_null<UserData*> user;
|
||||||
bool video = false;
|
bool video = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InviteResult {
|
struct InviteResult {
|
||||||
std::vector<not_null<UserData*>> invited;
|
std::vector<not_null<UserData*>> invited;
|
||||||
std::vector<not_null<UserData*>> alreadyIn;
|
std::vector<not_null<UserData*>> alreadyIn;
|
||||||
std::vector<not_null<UserData*>> privacyRestricted;
|
std::vector<not_null<UserData*>> privacyRestricted;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct StartConferenceInfo {
|
||||||
|
std::shared_ptr<Data::GroupCall> call;
|
||||||
|
std::shared_ptr<TdE2E::Call> e2e;
|
||||||
|
QString linkSlug;
|
||||||
|
MsgId joinMessageId;
|
||||||
|
std::vector<InviteRequest> invite;
|
||||||
|
bool migrating = false;
|
||||||
|
bool muted = false;
|
||||||
|
std::shared_ptr<tgcalls::VideoCaptureInterface> videoCapture;
|
||||||
|
QString videoCaptureScreenId;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Calls
|
} // namespace Calls
|
||||||
|
|
||||||
namespace Calls::Group {
|
namespace Calls::Group {
|
||||||
|
@ -101,13 +118,6 @@ struct JoinInfo {
|
||||||
bool rtmp = false;
|
bool rtmp = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ConferenceInfo {
|
|
||||||
std::shared_ptr<Data::GroupCall> call;
|
|
||||||
std::shared_ptr<TdE2E::Call> e2e;
|
|
||||||
QString linkSlug;
|
|
||||||
MsgId joinMessageId;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class PanelMode {
|
enum class PanelMode {
|
||||||
Default,
|
Default,
|
||||||
Wide,
|
Wide,
|
||||||
|
@ -158,9 +168,8 @@ struct ConferenceCallLinkStyleOverrides {
|
||||||
struct ConferenceCallLinkArgs {
|
struct ConferenceCallLinkArgs {
|
||||||
bool initial = false;
|
bool initial = false;
|
||||||
bool joining = false;
|
bool joining = false;
|
||||||
bool migrating = false;
|
|
||||||
Fn<void(QString)> finished;
|
Fn<void(QString)> finished;
|
||||||
std::vector<InviteRequest> invite;
|
StartConferenceInfo info;
|
||||||
ConferenceCallLinkStyleOverrides st;
|
ConferenceCallLinkStyleOverrides st;
|
||||||
};
|
};
|
||||||
void ShowConferenceCallLinkBox(
|
void ShowConferenceCallLinkBox(
|
||||||
|
@ -177,9 +186,8 @@ void ExportConferenceCallLink(
|
||||||
struct ConferenceFactoryArgs {
|
struct ConferenceFactoryArgs {
|
||||||
std::shared_ptr<Main::SessionShow> show;
|
std::shared_ptr<Main::SessionShow> show;
|
||||||
Fn<void(QString)> finished;
|
Fn<void(QString)> finished;
|
||||||
std::vector<InviteRequest> invite;
|
|
||||||
bool joining = false;
|
bool joining = false;
|
||||||
bool migrating = false;
|
StartConferenceInfo info;
|
||||||
};
|
};
|
||||||
void MakeConferenceCall(ConferenceFactoryArgs &&args);
|
void MakeConferenceCall(ConferenceFactoryArgs &&args);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue