mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Check unmuted video limit in group call.
This commit is contained in:
parent
801c8b6220
commit
402729dc99
3 changed files with 10 additions and 25 deletions
Telegram/SourceFiles
|
@ -677,20 +677,6 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> real) {
|
|||
setScheduledDate(date);
|
||||
}, _lifetime);
|
||||
|
||||
// If we joined before you could start video and then you can,
|
||||
// you have to rejoin so that the server knows your video params.
|
||||
//real->canStartVideoValue( // ignore can_start_video after call start.
|
||||
//) | rpl::combine_previous(
|
||||
//) | rpl::start_with_next([=](bool could, bool can) {
|
||||
// if (could || !can) {
|
||||
// return;
|
||||
// } if (_joinState.action == JoinAction::None) {
|
||||
// rejoin();
|
||||
// } else {
|
||||
// _joinState.nextActionPending = true;
|
||||
// }
|
||||
//}, _lifetime);
|
||||
|
||||
// Postpone creating video tracks, so that we know if Panel
|
||||
// supports OpenGL and we don't need ARGB32 frames at all.
|
||||
Ui::PostponeCall(this, [=] {
|
||||
|
@ -1965,9 +1951,10 @@ bool GroupCall::emitShareCameraError() {
|
|||
emitShareCameraError(error);
|
||||
return true;
|
||||
};
|
||||
/*if (const auto real = lookupReal(); real && !real->canStartVideo()) {
|
||||
if (const auto real = lookupReal()
|
||||
; real && _activeVideoTracks.size() >= real->unmutedVideoLimit()) {
|
||||
return emitError(Error::DisabledNoCamera);
|
||||
} else */if (!videoIsWorking()) {
|
||||
} else if (!videoIsWorking()) {
|
||||
return emitError(Error::DisabledNoCamera);
|
||||
} else if (mutedByAdmin()) {
|
||||
return emitError(Error::MutedNoCamera);
|
||||
|
@ -1991,9 +1978,10 @@ bool GroupCall::emitShareScreenError() {
|
|||
emitShareScreenError(error);
|
||||
return true;
|
||||
};
|
||||
/*if (const auto real = lookupReal(); real && !real->canStartVideo()) {
|
||||
if (const auto real = lookupReal()
|
||||
; real && _activeVideoTracks.size() >= real->unmutedVideoLimit()) {
|
||||
return emitError(Error::DisabledNoScreen);
|
||||
} else */if (!videoIsWorking()) {
|
||||
} else if (!videoIsWorking()) {
|
||||
return emitError(Error::DisabledNoScreen);
|
||||
} else if (mutedByAdmin()) {
|
||||
return emitError(Error::MutedNoScreen);
|
||||
|
|
|
@ -392,7 +392,7 @@ void GroupCall::applyCallFields(const MTPDgroupCall &data) {
|
|||
_recordStartDate = data.vrecord_start_date().value_or_empty();
|
||||
_scheduleDate = data.vschedule_date().value_or_empty();
|
||||
_scheduleStartSubscribed = data.is_schedule_start_subscribed();
|
||||
_canStartVideo = data.is_can_start_video();
|
||||
_unmutedVideoLimit = data.vunmuted_video_limit().v;
|
||||
_allParticipantsLoaded
|
||||
= (_serverParticipantsCount == _participants.size());
|
||||
}
|
||||
|
|
|
@ -95,11 +95,8 @@ public:
|
|||
[[nodiscard]] rpl::producer<bool> scheduleStartSubscribedValue() const {
|
||||
return _scheduleStartSubscribed.value();
|
||||
}
|
||||
[[nodiscard]] bool canStartVideo() const {
|
||||
return _canStartVideo.current();
|
||||
}
|
||||
[[nodiscard]] rpl::producer<bool> canStartVideoValue() const {
|
||||
return _canStartVideo.value();
|
||||
[[nodiscard]] int unmutedVideoLimit() const {
|
||||
return _unmutedVideoLimit.current();
|
||||
}
|
||||
|
||||
void setPeer(not_null<PeerData*> peer);
|
||||
|
@ -216,10 +213,10 @@ private:
|
|||
QString _nextOffset;
|
||||
int _serverParticipantsCount = 0;
|
||||
rpl::variable<int> _fullCount = 0;
|
||||
rpl::variable<int> _unmutedVideoLimit = 0;
|
||||
rpl::variable<TimeId> _recordStartDate = 0;
|
||||
rpl::variable<TimeId> _scheduleDate = 0;
|
||||
rpl::variable<bool> _scheduleStartSubscribed = false;
|
||||
rpl::variable<bool> _canStartVideo = false;
|
||||
|
||||
base::flat_map<uint32, LastSpokeTimes> _unknownSpokenSsrcs;
|
||||
base::flat_map<PeerId, LastSpokeTimes> _unknownSpokenPeerIds;
|
||||
|
|
Loading…
Add table
Reference in a new issue