From dba8022266efab3890e8961225fa8b8d2093ad12 Mon Sep 17 00:00:00 2001
From: Nicolas Jager <nicolas.jager@savoirfairelinux.com>
Date: Fri, 8 Dec 2017 13:58:12 -0500
Subject: [PATCH] call::Info, isAudioOnly inform about AUDIO_ONLY

Change-Id: I6a65c695fe43154c2445ddffe3b57ffbb679ca92
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
---
 src/api/call.h       | 1 +
 src/newcallmodel.cpp | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/api/call.h b/src/api/call.h
index d9f2cde1..94c99526 100644
--- a/src/api/call.h
+++ b/src/api/call.h
@@ -134,6 +134,7 @@ struct Info
     bool isOutoging;
     bool audioMuted = false;
     bool videoMuted = false;
+    bool isAudioOnly = false;
 };
 
 static inline bool
diff --git a/src/newcallmodel.cpp b/src/newcallmodel.cpp
index 0d55690c..a6703d00 100644
--- a/src/newcallmodel.cpp
+++ b/src/newcallmodel.cpp
@@ -370,7 +370,8 @@ NewCallModelPimpl::slotIncomingCall(const std::string& accountId, const std::str
 {
     if (linked.owner.id != accountId) return;
 
-    qDebug() << "NewCallModelPimpl::slotIncomingCall";
+    // do not use auto here (QDBusPendingReply<MapStringString>)
+    MapStringString callDetails = CallManager::instance().getCallDetails(callId.c_str());
 
     auto callInfo = std::make_shared<call::Info>();
     callInfo->id = callId;
@@ -378,6 +379,7 @@ NewCallModelPimpl::slotIncomingCall(const std::string& accountId, const std::str
     callInfo->isOutoging = false;
     callInfo->status =  call::Status::INCOMING_RINGING;
     callInfo->type =  call::Type::DIALOG;
+    callInfo->isAudioOnly = callDetails["AUDIO_ONLY"] == "true" ? true : false;
     calls.emplace(callId, std::move(callInfo));
 
     emit linked.newIncomingCall(fromId, callId);
-- 
GitLab