2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Close call panel instead of hiding.

This commit is contained in:
John Preston
2020-08-14 19:59:24 +04:00
parent 34840766b2
commit a0eb073728
5 changed files with 13 additions and 15 deletions

View File

@@ -55,11 +55,15 @@ void Instance::startOutgoingCall(not_null<UserData*> user, bool video) {
}
void Instance::callFinished(not_null<Call*> call) {
destroyCall(call);
crl::on_main(call, [=] {
destroyCall(call);
});
}
void Instance::callFailed(not_null<Call*> call) {
destroyCall(call);
crl::on_main(call, [=] {
destroyCall(call);
});
}
void Instance::callRedial(not_null<Call*> call) {
@@ -101,7 +105,9 @@ void Instance::playSound(Sound sound) {
void Instance::destroyCall(not_null<Call*> call) {
if (_currentCall.get() == call) {
destroyCurrentPanel();
_currentCallPanel->closeBeforeDestroy();
_currentCallPanel = nullptr;
auto taken = base::take(_currentCall);
_currentCallChanges.fire(nullptr);
taken.reset();
@@ -113,13 +119,6 @@ void Instance::destroyCall(not_null<Call*> call) {
}
}
void Instance::destroyCurrentPanel() {
_currentCallPanel->hideBeforeDestroy();
// Always queue the destruction.
crl::on_main([panel = std::move(_currentCallPanel)]{});
}
void Instance::createCall(not_null<UserData*> user, Call::Type type, bool video) {
auto call = std::make_unique<Call>(getCallDelegate(), user, type, video);
const auto raw = call.get();