Commit 80f964b2 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/components/call/CallModel): avoid video actions if the app was built without video support

parent 667aa7e1
......@@ -435,6 +435,12 @@ bool CallModel::getVideoEnabled () const {
}
void CallModel::setVideoEnabled (bool status) {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
if (!core->videoSupported()) {
qWarning() << QStringLiteral("Unable to update video call property. (Video not supported.)");
return;
}
switch (mCall->getState()) {
case linphone::CallStateConnected:
case linphone::CallStateStreamsRunning:
......@@ -445,7 +451,6 @@ void CallModel::setVideoEnabled (bool status) {
if (status == getVideoEnabled())
return;
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::CallParams> params = core->createCallParams(mCall);
params->enableVideo(status);
......
......@@ -93,8 +93,8 @@ void CallsListModel::askForTransfer (CallModel *callModel) {
void CallsListModel::launchAudioCall (const QString &sipUri) const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
if (!address)
return;
......@@ -107,8 +107,13 @@ void CallsListModel::launchAudioCall (const QString &sipUri) const {
void CallsListModel::launchVideoCall (const QString &sipUri) const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
if (!core->videoSupported()) {
qWarning() << QStringLiteral("Unable to launch video call. (Video not supported.) Launching audio call...");
launchAudioCall(sipUri);
return;
}
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
if (!address)
return;
......
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