Commit dfb8c8b7 authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Guillaume Roguez

lrc: fix how the default account is chosen

(cherry picked from commit 047544d0)

Also, do not allow RING accounts to make calls with
unidentified URI types (so that SIP or IP2IP is
always the fallback).

Refs #71348
parent 4d980ecd
......@@ -938,6 +938,8 @@ bool Account::supportScheme( URI::SchemeType type )
{
switch(type) {
case URI::SchemeType::NONE :
if (protocol() == Account::Protocol::RING)
return false;
return true;
break;
case URI::SchemeType::SIP :
......
......@@ -1334,7 +1334,7 @@ void CallPrivate::call()
Q_ASSERT_IS_IN_PROGRESS
CallManagerInterface& callManager = DBus::CallManager::instance();
qDebug() << "account = " << m_Account;
qDebug() << "account = " << m_Account << (m_Account? m_Account->alias() : "(no account)");
if(!m_Account) {
qDebug() << "Account is not set, taking the first registered.";
m_Account = AvailableAccountModel::currentDefaultAccount(m_pDialNumber);
......
......@@ -428,15 +428,7 @@ Call* CallModel::dialingCall(const QString& peerName, Account* account)
return call;
}
//No dialing call found, creating one
Account* acc = (account)?account:AvailableAccountModel::currentDefaultAccount();
if (!acc) {
qWarning() << "No account is available, cannot call" << QStringList(DBus::ConfigurationManager::instance().getAccountList());
return nullptr;
}
return d_ptr->addCall2(CallPrivate::buildDialingCall(peerName, acc));
return d_ptr->addCall2(CallPrivate::buildDialingCall(peerName, account));
} //dialingCall
///Create a new incoming call when the daemon is being called
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment