Replace non-started calls.

This commit is contained in:
John Preston 2024-11-23 10:04:55 +04:00
parent 03b6e2df17
commit edc6cfe210
2 changed files with 9 additions and 2 deletions

View file

@ -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 {

View file

@ -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,