Allow change join_as in scheduled call.
This commit is contained in:
parent
d7e90fec1a
commit
c2900db061
|
@ -457,6 +457,15 @@ void GroupCall::rejoinWithHash(const QString &hash) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GroupCall::setJoinAs(not_null<PeerData*> as) {
|
||||||
|
_joinAs = as;
|
||||||
|
if (const auto chat = _peer->asChat()) {
|
||||||
|
chat->setGroupCallDefaultJoinAs(_joinAs->id);
|
||||||
|
} else if (const auto channel = _peer->asChannel()) {
|
||||||
|
channel->setGroupCallDefaultJoinAs(_joinAs->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GroupCall::rejoin(not_null<PeerData*> as) {
|
void GroupCall::rejoin(not_null<PeerData*> as) {
|
||||||
if (state() != State::Joining
|
if (state() != State::Joining
|
||||||
&& state() != State::Joined
|
&& state() != State::Joined
|
||||||
|
@ -472,12 +481,7 @@ void GroupCall::rejoin(not_null<PeerData*> as) {
|
||||||
applyMeInCallLocally();
|
applyMeInCallLocally();
|
||||||
LOG(("Call Info: Requesting join payload."));
|
LOG(("Call Info: Requesting join payload."));
|
||||||
|
|
||||||
_joinAs = as;
|
setJoinAs(as);
|
||||||
if (const auto chat = _peer->asChat()) {
|
|
||||||
chat->setGroupCallDefaultJoinAs(_joinAs->id);
|
|
||||||
} else if (const auto channel = _peer->asChannel()) {
|
|
||||||
channel->setGroupCallDefaultJoinAs(_joinAs->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto weak = base::make_weak(this);
|
const auto weak = base::make_weak(this);
|
||||||
_instance->emitJoinPayload([=](tgcalls::GroupJoinPayload payload) {
|
_instance->emitJoinPayload([=](tgcalls::GroupJoinPayload payload) {
|
||||||
|
@ -691,7 +695,13 @@ void GroupCall::rejoinAs(Group::JoinInfo info) {
|
||||||
.wasJoinAs = _joinAs,
|
.wasJoinAs = _joinAs,
|
||||||
.nowJoinAs = info.joinAs,
|
.nowJoinAs = info.joinAs,
|
||||||
};
|
};
|
||||||
if (!_scheduleDate) {
|
if (_scheduleDate) {
|
||||||
|
setJoinAs(info.joinAs);
|
||||||
|
_api.request(MTPphone_SaveDefaultGroupCallJoinAs(
|
||||||
|
_peer->input,
|
||||||
|
_joinAs->input
|
||||||
|
)).send();
|
||||||
|
} else {
|
||||||
setState(State::Joining);
|
setState(State::Joining);
|
||||||
rejoin(info.joinAs);
|
rejoin(info.joinAs);
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,6 +255,7 @@ private:
|
||||||
void applyMeInCallLocally();
|
void applyMeInCallLocally();
|
||||||
void rejoin();
|
void rejoin();
|
||||||
void rejoin(not_null<PeerData*> as);
|
void rejoin(not_null<PeerData*> as);
|
||||||
|
void setJoinAs(not_null<PeerData*> as);
|
||||||
void subscribeToReal(not_null<Data::GroupCall*> real);
|
void subscribeToReal(not_null<Data::GroupCall*> real);
|
||||||
|
|
||||||
void audioLevelsUpdated(const tgcalls::GroupLevelsUpdate &data);
|
void audioLevelsUpdated(const tgcalls::GroupLevelsUpdate &data);
|
||||||
|
|
Loading…
Reference in New Issue