mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Try to hangup current call when quitting the app.
This commit is contained in:
@@ -21,6 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "calls/calls_instance.h"
|
||||
|
||||
#include "mtproto/connection.h"
|
||||
#include "messenger.h"
|
||||
#include "auth_session.h"
|
||||
#include "apiwrap.h"
|
||||
#include "lang.h"
|
||||
@@ -70,6 +71,11 @@ void Instance::destroyCall(gsl::not_null<Call*> call) {
|
||||
_currentCallPanel.reset();
|
||||
_currentCall.reset();
|
||||
_currentCallChanged.notify(nullptr, true);
|
||||
|
||||
if (App::quitting()) {
|
||||
LOG(("Calls::Instance doesn't prevent quit any more."));
|
||||
}
|
||||
Messenger::Instance().quitPreventFinished();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,6 +207,18 @@ void Instance::showInfoPanel(gsl::not_null<Call*> call) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Instance::isQuitPrevent() {
|
||||
if (!_currentCall) {
|
||||
return false;
|
||||
}
|
||||
_currentCall->hangup();
|
||||
if (!_currentCall) {
|
||||
return false;
|
||||
}
|
||||
LOG(("Calls::Instance prevents quit, saving drafts..."));
|
||||
return true;
|
||||
}
|
||||
|
||||
void Instance::handleCallUpdate(const MTPPhoneCall &call) {
|
||||
if (call.type() == mtpc_phoneCallRequested) {
|
||||
auto &phoneCall = call.c_phoneCallRequested();
|
||||
|
Reference in New Issue
Block a user