mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +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();
|
||||
|
||||
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(
|
||||
) | rpl::filter([=](const LevelUpdate &update) {
|
||||
return update.self;
|
||||
|
|
|
@ -196,6 +196,9 @@ void Instance::destroyGroupCall(not_null<GroupCall*> call) {
|
|||
void Instance::createGroupCall(
|
||||
not_null<ChannelData*> channel,
|
||||
const MTPInputGroupCall &inputCall) {
|
||||
if (_currentGroupCall) {
|
||||
destroyGroupCall(_currentGroupCall.get());
|
||||
}
|
||||
auto call = std::make_unique<GroupCall>(
|
||||
getGroupCallDelegate(),
|
||||
channel,
|
||||
|
@ -433,7 +436,14 @@ bool Instance::inCall() 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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue