mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Hide call panel when starting hanging up.
This commit is contained in:
parent
33fc3fe354
commit
529c12ea3a
2 changed files with 21 additions and 1 deletions
|
@ -353,6 +353,16 @@ void GroupPanel::initWithCall(GroupCall *call) {
|
||||||
|
|
||||||
_channel = _call->channel();
|
_channel = _call->channel();
|
||||||
|
|
||||||
|
call->stateValue(
|
||||||
|
) | rpl::filter([](State state) {
|
||||||
|
return (state == State::HangingUp)
|
||||||
|
|| (state == State::Ended)
|
||||||
|
|| (state == State::FailedHangingUp)
|
||||||
|
|| (state == State::Failed);
|
||||||
|
}) | rpl::start_with_next([=] {
|
||||||
|
closeBeforeDestroy();
|
||||||
|
}, _callLifetime);
|
||||||
|
|
||||||
call->levelUpdates(
|
call->levelUpdates(
|
||||||
) | rpl::filter([=](const LevelUpdate &update) {
|
) | rpl::filter([=](const LevelUpdate &update) {
|
||||||
return update.self;
|
return update.self;
|
||||||
|
|
|
@ -196,6 +196,9 @@ void Instance::destroyGroupCall(not_null<GroupCall*> call) {
|
||||||
void Instance::createGroupCall(
|
void Instance::createGroupCall(
|
||||||
not_null<ChannelData*> channel,
|
not_null<ChannelData*> channel,
|
||||||
const MTPInputGroupCall &inputCall) {
|
const MTPInputGroupCall &inputCall) {
|
||||||
|
if (_currentGroupCall) {
|
||||||
|
destroyGroupCall(_currentGroupCall.get());
|
||||||
|
}
|
||||||
auto call = std::make_unique<GroupCall>(
|
auto call = std::make_unique<GroupCall>(
|
||||||
getGroupCallDelegate(),
|
getGroupCallDelegate(),
|
||||||
channel,
|
channel,
|
||||||
|
@ -433,7 +436,14 @@ bool Instance::inCall() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Instance::inGroupCall() const {
|
bool Instance::inGroupCall() const {
|
||||||
return (_currentGroupCall != nullptr);
|
if (!_currentGroupCall) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const auto state = _currentGroupCall->state();
|
||||||
|
return (state != GroupCall::State::HangingUp)
|
||||||
|
&& (state != GroupCall::State::Ended)
|
||||||
|
&& (state != GroupCall::State::FailedHangingUp)
|
||||||
|
&& (state != GroupCall::State::Failed);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Instance::activateCurrentCall() {
|
bool Instance::activateCurrentCall() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue