mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-27 08:49:19 +00:00
fix(src/components/call/CallModel): use auto-answer only if one call exists
This commit is contained in:
parent
a0e92affcd
commit
32e737fcf1
2 changed files with 17 additions and 6 deletions
|
|
@ -51,7 +51,7 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
|
|||
timer->setSingleShot(true);
|
||||
timer->setObjectName(AUTO_ANSWER_OBJECT_NAME);
|
||||
|
||||
QObject::connect(timer, &QTimer::timeout, this, &CallModel::accept);
|
||||
QObject::connect(timer, &QTimer::timeout, this, &CallModel::acceptWithAutoAnswerDelay);
|
||||
timer->start();
|
||||
}
|
||||
}
|
||||
|
|
@ -298,6 +298,19 @@ CallModel::CallStatus CallModel::getStatus () const {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallModel::acceptWithAutoAnswerDelay () {
|
||||
// Use auto-answer if activated and it's the only call.
|
||||
CoreManager *coreManager = CoreManager::getInstance();
|
||||
if (coreManager->getSettingsModel()->getAutoAnswerStatus() && coreManager->getCore()->getCallsNb() == 1)
|
||||
accept();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString CallModel::getCallError () const {
|
||||
return mCallError;
|
||||
}
|
||||
|
||||
void CallModel::setCallErrorFromReason (linphone::Reason reason) {
|
||||
switch (reason) {
|
||||
case linphone::ReasonDeclined:
|
||||
|
|
@ -322,10 +335,6 @@ void CallModel::setCallErrorFromReason (linphone::Reason reason) {
|
|||
emit callErrorChanged(mCallError);
|
||||
}
|
||||
|
||||
QString CallModel::getCallError () const {
|
||||
return mCallError;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
int CallModel::getDuration () const {
|
||||
|
|
|
|||
|
|
@ -110,8 +110,10 @@ private:
|
|||
return mCall->getDir() == linphone::CallDirOutgoing;
|
||||
}
|
||||
|
||||
void setCallErrorFromReason (linphone::Reason reason);
|
||||
void acceptWithAutoAnswerDelay ();
|
||||
|
||||
QString getCallError () const;
|
||||
void setCallErrorFromReason (linphone::Reason reason);
|
||||
|
||||
int getDuration () const;
|
||||
float getQuality () const;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue