Reload stale video chat on join.

This commit is contained in:
John Preston 2022-04-25 13:41:24 +04:00
parent a23561c380
commit 73d00a4caf
2 changed files with 9 additions and 0 deletions

View File

@ -1065,6 +1065,7 @@ void GroupCall::start(TimeId scheduleDate, bool rtmp) {
MTPstring(), // title
MTP_int(scheduleDate)
)).done([=](const MTPUpdates &result) {
_reloadedStaleCall = true;
_acceptFields = true;
_peer->session().api().applyUpdates(result);
_acceptFields = false;
@ -1393,6 +1394,13 @@ void GroupCall::rejoin(not_null<PeerData*> as) {
sendSelfUpdate(SendUpdateType::CameraPaused);
}
sendPendingSelfUpdates();
if (!_reloadedStaleCall
&& _state.current() != State::Joining) {
if (const auto real = lookupReal()) {
_reloadedStaleCall = true;
real->reloadIfStale();
}
}
}).fail([=](const MTP::Error &error) {
_joinState.finish();

View File

@ -674,6 +674,7 @@ private:
bool _hadJoinedState = false;
bool _listenersHidden = false;
bool _rtmp = false;
bool _reloadedStaleCall = false;
int _rtmpVolume = 0;
std::unique_ptr<Webrtc::MediaDevices> _mediaDevices;