mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-13 04:37:11 +02:00
Replace non-started calls.
This commit is contained in:
parent
03b6e2df17
commit
edc6cfe210
2 changed files with 9 additions and 2 deletions
|
@ -669,7 +669,8 @@ bool Instance::inCall() const {
|
|||
return false;
|
||||
}
|
||||
const auto state = _currentCall->state();
|
||||
return (state != Call::State::Busy);
|
||||
return (state != Call::State::Busy)
|
||||
&& (state != Call::State::WaitingUserConfirmation);
|
||||
}
|
||||
|
||||
bool Instance::inGroupCall() const {
|
||||
|
|
|
@ -993,7 +993,12 @@ void Panel::paint(QRect clip) {
|
|||
|
||||
bool Panel::handleClose() const {
|
||||
if (_call) {
|
||||
window()->hide();
|
||||
if (_call->state() == Call::State::WaitingUserConfirmation
|
||||
|| _call->state() == Call::State::Busy) {
|
||||
_call->hangup();
|
||||
} else {
|
||||
window()->hide();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1028,6 +1033,7 @@ void Panel::stateChanged(State state) {
|
|||
_startVideo = base::make_unique_q<Ui::CallButton>(
|
||||
widget(),
|
||||
st::callStartVideo);
|
||||
_startVideo->show();
|
||||
_startVideo->setText(tr::lng_call_start_video());
|
||||
_startVideo->clicks() | rpl::map_to(true) | rpl::start_to_stream(
|
||||
_startOutgoingRequests,
|
||||
|
|
Loading…
Add table
Reference in a new issue