trust pending contact if incoming call accepted
If a pending contact is trying to reach us by a call and we accept, it
is then trusted implicitly and thus moved to the "Conversations" list.
Change-Id: Id24e245eeb7bdd002a0a637f4ab450067d2233a0
diff --git a/src/CurrentCallVC.mm b/src/CurrentCallVC.mm
index fa478fe..83ece8e 100644
--- a/src/CurrentCallVC.mm
+++ b/src/CurrentCallVC.mm
@@ -636,6 +636,14 @@
if (accountInfo_ == nil)
return;
+ // If we accept a conversation with a non trusted contact, we first accept it
+ auto convIt = getConversationFromUid(convUid_, *accountInfo_->conversationModel.get());
+ if (convIt != accountInfo_->conversationModel->allFilteredConversations().end()) {
+ auto& contact = accountInfo_->contactModel->getContact(convIt->participants[0]);
+ if (contact.profileInfo.type == lrc::api::profile::Type::PENDING)
+ accountInfo_->conversationModel->makePermanent(convUid_);
+ }
+
auto* callModel = accountInfo_->callModel.get();
callModel->accept(callUid_);