call : shows incoming call status.
- status shown below the contact name inside the smartpanel.
Change-Id: Iffc3114606ec07ae8fea8521d109a5c639bc226c
Tuleap: #993
diff --git a/ContactsViewModel.cpp b/ContactsViewModel.cpp
index fb1c8d9..68141b5 100644
--- a/ContactsViewModel.cpp
+++ b/ContactsViewModel.cpp
@@ -64,6 +64,22 @@
saveContactsToFile();
}
});
+ CallsViewModel::instance->callRecieved += ref new RingClientUWP::CallRecieved([&](
+ Call^ call) {
+ auto from = call->from;
+ auto contact = findContactByName(from);
+
+ if (contact == nullptr)
+ contact = addNewContact(from, from); // contact checked inside addNewContact.
+
+ bool isNotSelected = (contact != ContactsViewModel::instance->selectedContact) ? true : false;
+
+ if (contact == nullptr) {
+ ERR_("contact not handled!");
+ return;
+ }
+ contact->_call = call;
+ });
}