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

ConversationModel: use index in slotCallEnded

Change-Id: I2d2952007ce1c437bac9c96d35c2931816f185ac
This commit is contained in:
Adrien Béraud 2024-07-17 16:36:35 -04:00
parent 73eacd5125
commit 3143d60760

View file

@ -3242,13 +3242,16 @@ ConversationModelPimpl::slotCallEnded(const QString& callId)
addOrUpdateCallMessage(callId, call.peerUri.remove("ring:"), !call.isOutgoing, duration);
/* Reset the callId stored in the conversation.
Do not call selectConversation() since it is already done in slotCallStatusChanged. */
for (auto& conversation : conversations)
size_t idx = 0;
for (auto& conversation : conversations) {
if (conversation.callId == callId) {
conversation.callId = "";
conversation.confId = ""; // The participant is detached
invalidateModel();
Q_EMIT linked.conversationUpdated(conversation.uid);
Q_EMIT linked.dataChanged(indexOf(conversation.uid));
Q_EMIT linked.dataChanged(idx);
}
++idx;
}
} catch (std::out_of_range& e) {
qDebug() << "ConversationModelPimpl::slotCallEnded cannot end nonexistent call.";