2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Share instead of Settings for scheduled voice chats.

This commit is contained in:
John Preston
2021-04-07 14:56:53 +04:00
parent 96bc4858c1
commit 65dd9b82c0
10 changed files with 118 additions and 50 deletions

View File

@@ -244,6 +244,9 @@ GroupCall::GroupCall(
} else {
start(info.scheduleDate);
}
if (_scheduleDate) {
saveDefaultJoinAs(_joinAs);
}
_mediaDevices->audioInputId(
) | rpl::start_with_next([=](QString id) {
@@ -465,6 +468,14 @@ void GroupCall::setJoinAs(not_null<PeerData*> as) {
}
}
void GroupCall::saveDefaultJoinAs(not_null<PeerData*> as) {
setJoinAs(as);
_api.request(MTPphone_SaveDefaultGroupCallJoinAs(
_peer->input,
_joinAs->input
)).send();
}
void GroupCall::rejoin(not_null<PeerData*> as) {
if (state() != State::Joining
&& state() != State::Joined
@@ -695,11 +706,7 @@ void GroupCall::rejoinAs(Group::JoinInfo info) {
.nowJoinAs = info.joinAs,
};
if (_scheduleDate) {
setJoinAs(info.joinAs);
_api.request(MTPphone_SaveDefaultGroupCallJoinAs(
_peer->input,
_joinAs->input
)).send();
saveDefaultJoinAs(info.joinAs);
} else {
setState(State::Joining);
rejoin(info.joinAs);