From 7f414f652e88fd562654d47dd10d7efc7e02ef94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Thu, 16 Nov 2023 13:37:12 -0500 Subject: [PATCH] callmodel: remove old TODO This was causing some weird conference states for swarm-call https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/916 Change-Id: I87ada927f223bc325eb0f62307c6dda51b330330 --- src/libclient/callmodel.cpp | 37 ++++++++++++++++------------- src/libclient/conversationmodel.cpp | 10 ++++++-- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/libclient/callmodel.cpp b/src/libclient/callmodel.cpp index fc799afcb..ee52a15e3 100644 --- a/src/libclient/callmodel.cpp +++ b/src/libclient/callmodel.cpp @@ -495,7 +495,12 @@ CallModel::replaceDefaultCamera(const QString& callId, const QString& deviceId) } VectorMapStringString -CallModel::getProposed(VectorMapStringString mediaList, const QString& callId, const QString& source, MediaRequestType type, bool mute, bool shareAudio) +CallModel::getProposed(VectorMapStringString mediaList, + const QString& callId, + const QString& source, + MediaRequestType type, + bool mute, + bool shareAudio) { auto& callInfo = pimpl_->calls[callId]; if (!callInfo || source.isEmpty()) @@ -526,10 +531,10 @@ CallModel::getProposed(VectorMapStringString mediaList, const QString& callId, c : libjami::Media::VideoProtocolPrefix::NONE; if (shareAudio) audioMediaAttribute = {{MediaAttributeKey::MEDIA_TYPE, MediaAttributeValue::AUDIO}, - {MediaAttributeKey::ENABLED, TRUE_STR}, - {MediaAttributeKey::MUTED, mute ? TRUE_STR : FALSE_STR}, - {MediaAttributeKey::SOURCE, resource}, - {MediaAttributeKey::LABEL, alabel}}; + {MediaAttributeKey::ENABLED, TRUE_STR}, + {MediaAttributeKey::MUTED, mute ? TRUE_STR : FALSE_STR}, + {MediaAttributeKey::SOURCE, resource}, + {MediaAttributeKey::LABEL, alabel}}; break; } case MediaRequestType::SCREENSHARING: { @@ -551,7 +556,8 @@ CallModel::getProposed(VectorMapStringString mediaList, const QString& callId, c } VectorMapStringString proposedList {}; - MapStringString videoMediaAttribute = {{MediaAttributeKey::MEDIA_TYPE, MediaAttributeValue::VIDEO}, + MapStringString videoMediaAttribute = {{MediaAttributeKey::MEDIA_TYPE, + MediaAttributeValue::VIDEO}, {MediaAttributeKey::ENABLED, TRUE_STR}, {MediaAttributeKey::MUTED, mute ? TRUE_STR : FALSE_STR}, {MediaAttributeKey::SOURCE, resource}, @@ -593,9 +599,9 @@ CallModel::getProposed(VectorMapStringString mediaList, const QString& callId, c return proposedList; } - void -CallModel::addMedia(const QString& callId, const QString& source, MediaRequestType type, bool mute, bool shareAudio) +CallModel::addMedia( + const QString& callId, const QString& source, MediaRequestType type, bool mute, bool shareAudio) { auto& callInfo = pimpl_->calls[callId]; if (!callInfo || source.isEmpty()) @@ -1448,7 +1454,7 @@ CallModelPimpl::slotCallStateChanged(const QString& accountId, callInfo->mediaList = {}; calls.emplace(callId, std::move(callInfo)); - if (!(details["CALL_TYPE"] == "1") && !linked.owner.confProperties.allowIncoming + if (!(details["CALL_TYPE"] == "1") && !linked.owner.confProperties.allowIncoming && linked.owner.profileInfo.type == profile::Type::JAMI) { linked.refuse(callId); return; @@ -1473,7 +1479,11 @@ CallModelPimpl::slotCallStateChanged(const QString& accountId, qDebug() << displayname; qDebug() << peerId; - Q_EMIT linked.newCall(peerId, callId, displayname, details["CALL_TYPE"] == "1", details["TO_USERNAME"]); + Q_EMIT linked.newCall(peerId, + callId, + displayname, + details["CALL_TYPE"] == "1", + details["TO_USERNAME"]); // NOTE: signal emission order matters, always emit CallStatusChanged before CallEnded Q_EMIT linked.callStatusChanged(callId, code); @@ -1524,13 +1534,6 @@ CallModelPimpl::slotCallStateChanged(const QString& accountId, } else if (call->status == call::Status::IN_PROGRESS) { if (previousStatus == call::Status::INCOMING_RINGING || previousStatus == call::Status::OUTGOING_RINGING) { - if (previousStatus == call::Status::INCOMING_RINGING - && linked.owner.profileInfo.type != profile::Type::SIP - && !linked.owner.confProperties.autoAnswer - && !linked.owner.confProperties.isRendezVous) { // TODO remove this when we want to - // not show calls in rendez-vous - linked.setCurrentCall(callId); - } call->startTime = std::chrono::steady_clock::now(); Q_EMIT linked.callStarted(callId); sendProfile(callId); diff --git a/src/libclient/conversationmodel.cpp b/src/libclient/conversationmodel.cpp index b5bb4a4cb..e2660bdfa 100644 --- a/src/libclient/conversationmodel.cpp +++ b/src/libclient/conversationmodel.cpp @@ -273,7 +273,10 @@ public Q_SLOTS: * @param isOutgoing * @param toUri */ - void slotNewCall(const QString& fromId, const QString& callId, bool isOutgoing, const QString& toUri); + void slotNewCall(const QString& fromId, + const QString& callId, + bool isOutgoing, + const QString& toUri); /** * Listen from callmodel for calls status changed. * @param callId @@ -3368,7 +3371,10 @@ ConversationModelPimpl::getIndicesForContact(const QString& uri) const } void -ConversationModelPimpl::slotNewCall(const QString& fromId, const QString& callId, bool isOutgoing, const QString& toUri) +ConversationModelPimpl::slotNewCall(const QString& fromId, + const QString& callId, + bool isOutgoing, + const QString& toUri) { if (isOutgoing) { // search contact -- GitLab