Commit 529ca3c1 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

call: handle PEER_BUSY state

Change-Id: I59072ab5cca3274ecc808b2c6e6f00c6c9850eb3
parent 662e7260
...@@ -1662,13 +1662,13 @@ ConversationModelPimpl::slotCallStatusChanged(const std::string& callId, int cod ...@@ -1662,13 +1662,13 @@ ConversationModelPimpl::slotCallStatusChanged(const std::string& callId, int cod
return conversation.callId == callId; return conversation.callId == callId;
}); });
if (i == conversations.end()) { try {
// In this case, the user didn't pass through placeCall auto call = linked.owner.callModel->getCall(callId);
// This means that a participant was invited to a call if (i == conversations.end()) {
// or a call was placed via dbus. // In this case, the user didn't pass through placeCall
// We have to update the model // This means that a participant was invited to a call
try { // or a call was placed via dbus.
auto call = linked.owner.callModel->getCall(callId); // We have to update the model
for (auto& conversation: conversations) { for (auto& conversation: conversations) {
if (conversation.participants.front() == call.peerUri) { if (conversation.participants.front() == call.peerUri) {
conversation.callId = callId; conversation.callId = callId;
...@@ -1676,10 +1676,11 @@ ConversationModelPimpl::slotCallStatusChanged(const std::string& callId, int cod ...@@ -1676,10 +1676,11 @@ ConversationModelPimpl::slotCallStatusChanged(const std::string& callId, int cod
emit linked.conversationUpdated(conversation.uid); emit linked.conversationUpdated(conversation.uid);
} }
} }
} catch (std::out_of_range& e) { } else if (call.status == call::Status::PEER_BUSY) {
qDebug() << "ConversationModelPimpl::slotCallStatusChanged can't get inexistant call"; emit behaviorController.showLeaveMessageView(linked.owner.id, *i);
} }
return; } catch (std::out_of_range& e) {
qDebug() << "ConversationModelPimpl::slotCallStatusChanged can't get inexistant call";
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment