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

Update API scheme with voice chat links.

This commit is contained in:
John Preston
2021-03-09 19:12:37 +04:00
parent 18901a4dc7
commit b24e5ce809
3 changed files with 14 additions and 4 deletions

View File

@@ -381,6 +381,10 @@ void GroupCall::join(const MTPInputGroupCall &inputCall) {
}
void GroupCall::rejoin() {
rejoin(_joinAs);
}
void GroupCall::rejoin(not_null<PeerData*> as) {
if (state() != State::Joining
&& state() != State::Joined
&& state() != State::Connecting) {
@@ -395,6 +399,8 @@ void GroupCall::rejoin() {
applyMeInCallLocally();
LOG(("Call Info: Requesting join payload."));
_joinAs = as;
const auto weak = base::make_weak(this);
_instance->emitJoinPayload([=](tgcalls::GroupJoinPayload payload) {
crl::on_main(weak, [=, payload = std::move(payload)]{
@@ -429,6 +435,7 @@ void GroupCall::rejoin() {
: Flag(0)),
inputCall(),
_joinAs->input,
MTPstring(), // #TODO calls invite_hash
MTP_dataJSON(MTP_bytes(json))
)).done([=](const MTPUpdates &updates) {
_mySsrc = ssrc;
@@ -581,9 +588,8 @@ void GroupCall::rejoinAs(Group::JoinInfo info) {
.wasJoinAs = _joinAs,
.nowJoinAs = info.joinAs,
};
_joinAs = info.joinAs;
setState(State::Joining);
rejoin();
rejoin(info.joinAs);
_rejoinEvents.fire_copy(event);
}