1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 12:03:18 +02:00

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
This commit is contained in:
Sébastien Blin 2023-11-16 13:37:12 -05:00
parent c6833d69fb
commit 7f414f652e
2 changed files with 28 additions and 19 deletions

View file

@ -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);

View file

@ -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