mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-29 19:23:40 +02:00
conversationmodel: handle double call at the same time
If both sides are calling at the same time, the daemon will chose one of the call. We must use this one. https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/743 Change-Id: I09c991c0facf34cf7ed83d8782b7646b3075eed8
This commit is contained in:
parent
8716154b58
commit
8a15f18d1c
2 changed files with 12 additions and 3 deletions
2
daemon
2
daemon
|
@ -1 +1 @@
|
|||
Subproject commit b256d6495954f929005231139cbb7aa8f8d66f92
|
||||
Subproject commit 59d063c94b00f511c331a18c073d8f145924a9fb
|
|
@ -3484,7 +3484,15 @@ ConversationModelPimpl::slotCallStatusChanged(const QString& callId, int code)
|
|||
if (peers.size() != 1) {
|
||||
continue;
|
||||
}
|
||||
if (peers.front() == call.peerUri) {
|
||||
if (peers.front() == call.peerUri.remove("ring:")) {
|
||||
if (!conversation.callId.isEmpty()) {
|
||||
// If outgoing and incoming happen at the same time, choose the current one.
|
||||
auto call = linked.owner.callModel->getCall(conversation.callId);
|
||||
qWarning() << "Double call detected" << call::to_string(call.status) << " - " << conversation.callId;
|
||||
// Ignore new call in favor of existing one
|
||||
if (call.status == call::Status::IN_PROGRESS)
|
||||
return;
|
||||
}
|
||||
conversation.callId = callId;
|
||||
// Update interaction status
|
||||
invalidateModel();
|
||||
|
@ -3569,7 +3577,8 @@ ConversationModelPimpl::addOrUpdateCallMessage(const QString& callId,
|
|||
}
|
||||
try {
|
||||
auto& conv = getConversationForPeerUri(from).get();
|
||||
conv.callId = callId;
|
||||
if (conv.callId.isEmpty())
|
||||
conv.callId = callId;
|
||||
} catch (...) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue