mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 08:04:08 +02:00
Update tgcalls for better stream->rtc upgrade.
This commit is contained in:
parent
81e08599dc
commit
18901a4dc7
3 changed files with 12 additions and 6 deletions
|
@ -914,8 +914,8 @@ void GroupCall::ensureControllerCreated() {
|
||||||
tgcalls::GroupInstanceDescriptor descriptor = {
|
tgcalls::GroupInstanceDescriptor descriptor = {
|
||||||
.config = tgcalls::GroupConfig{
|
.config = tgcalls::GroupConfig{
|
||||||
},
|
},
|
||||||
.networkStateUpdated = [=](bool connected) {
|
.networkStateUpdated = [=](tgcalls::GroupNetworkState networkState) {
|
||||||
crl::on_main(weak, [=] { setInstanceConnected(connected); });
|
crl::on_main(weak, [=] { setInstanceConnected(networkState); });
|
||||||
},
|
},
|
||||||
.audioLevelsUpdated = [=](const tgcalls::GroupLevelsUpdate &data) {
|
.audioLevelsUpdated = [=](const tgcalls::GroupLevelsUpdate &data) {
|
||||||
const auto &updates = data.updates;
|
const auto &updates = data.updates;
|
||||||
|
@ -1213,13 +1213,18 @@ void GroupCall::checkJoined() {
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupCall::setInstanceConnected(bool connected) {
|
void GroupCall::setInstanceConnected(
|
||||||
|
tgcalls::GroupNetworkState networkState) {
|
||||||
|
const auto connected = networkState.isConnected;
|
||||||
if (_instanceConnected == connected) {
|
if (_instanceConnected == connected) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_instanceConnected = connected;
|
_instanceConnected = connected;
|
||||||
if (state() == State::Connecting && connected) {
|
if (state() == State::Connecting && connected) {
|
||||||
setState(State::Joined);
|
setState(State::Joined);
|
||||||
|
if (networkState.isTransitioningFromBroadcastToRtc) {
|
||||||
|
// #TODO calls play sound?..
|
||||||
|
}
|
||||||
} else if (state() == State::Joined && !connected) {
|
} else if (state() == State::Joined && !connected) {
|
||||||
setState(State::Connecting);
|
setState(State::Connecting);
|
||||||
}
|
}
|
||||||
|
@ -1238,7 +1243,7 @@ void GroupCall::setInstanceMode(InstanceMode mode) {
|
||||||
case InstanceMode::Stream: return Mode::GroupConnectionModeBroadcast;
|
case InstanceMode::Stream: return Mode::GroupConnectionModeBroadcast;
|
||||||
}
|
}
|
||||||
Unexpected("Mode in GroupCall::setInstanceMode.");
|
Unexpected("Mode in GroupCall::setInstanceMode.");
|
||||||
}());
|
}(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupCall::maybeSendMutedUpdate(MuteState previous) {
|
void GroupCall::maybeSendMutedUpdate(MuteState previous) {
|
||||||
|
|
|
@ -18,6 +18,7 @@ class History;
|
||||||
namespace tgcalls {
|
namespace tgcalls {
|
||||||
class GroupInstanceCustomImpl;
|
class GroupInstanceCustomImpl;
|
||||||
struct GroupLevelsUpdate;
|
struct GroupLevelsUpdate;
|
||||||
|
struct GroupNetworkState;
|
||||||
struct GroupParticipantDescription;
|
struct GroupParticipantDescription;
|
||||||
} // namespace tgcalls
|
} // namespace tgcalls
|
||||||
|
|
||||||
|
@ -222,7 +223,7 @@ private:
|
||||||
void rejoin();
|
void rejoin();
|
||||||
|
|
||||||
void audioLevelsUpdated(const tgcalls::GroupLevelsUpdate &data);
|
void audioLevelsUpdated(const tgcalls::GroupLevelsUpdate &data);
|
||||||
void setInstanceConnected(bool connected);
|
void setInstanceConnected(tgcalls::GroupNetworkState networkState);
|
||||||
void setInstanceMode(InstanceMode mode);
|
void setInstanceMode(InstanceMode mode);
|
||||||
void checkLastSpoke();
|
void checkLastSpoke();
|
||||||
void pushToTalkCancel();
|
void pushToTalkCancel();
|
||||||
|
|
2
Telegram/ThirdParty/tgcalls
vendored
2
Telegram/ThirdParty/tgcalls
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit c3c3473f0f0373ff417675c8825a3b091649e563
|
Subproject commit d19c74b1474e4aab01d797373f1d62e4da5f87a5
|
Loading…
Add table
Reference in a new issue