/// <summary> /// Callback called when the search on a phone number or an email for a contact has a match /// </summary> private void cm_ContactFound(object sender, ContactFoundEventArgs e) { string address = e.PhoneNumber; string displayName = address; if (e.ContactFound != null) { displayName = e.ContactFound.DisplayName; Conversation conv = null; foreach (var conversation in _conversations) { if (conversation.SipAddress.Equals(e.Request)) { conv = conversation; break; } } if (conv != null) { _conversations.Remove(conv); conv.DisplayedName = displayName; _conversations.Add(conv); } _sortedConversations = new ObservableCollection<Conversation>(); foreach (var i in _conversations.OrderByDescending(g => g.Messages.Last().Time).ToList()) { _sortedConversations.Add(i); } ((ChatsModel)ViewModel).Conversations = _sortedConversations; } }
private void OnContactFound(object sender, ContactFoundEventArgs e) { if (e.ContactFound != null) { Debug.WriteLine("[LinphoneManager] Contact found: " + e.ContactFound.ContactName + "\r\n"); // Store the contact name as display name for call logs if (LinphoneManager.Instance.Core.CurrentCall != null) { LinphoneManager.Instance.Core.CurrentCall.RemoteAddress.DisplayName = e.ContactFound.ContactName; } } ContactManager.ContactFound -= OnContactFound; }
/// <summary> /// Callback called when the search on a phone number for a contact has a match /// </summary> private void cm_ContactFound(object sender, ContactFoundEventArgs e) { if (e.ContactFound != null) { Contact.Text = e.ContactFound.DisplayName; if (e.PhoneLabel != null) { Number.Text = e.PhoneLabel + " : " + e.PhoneNumber; } else { Number.Text = e.PhoneNumber; } } }
/// <summary> /// Callback called when the search on a phone number or an email for a contact has a match /// </summary> private void cm_ContactFound(object sender, ContactFoundEventArgs e) { if (e.ContactFound != null) { ContactName.Text = e.ContactFound.DisplayName; ContactManager.Instance.TempContact = e.ContactFound; ContactName.Tap += ContactName_Tap; ContactName.Visibility = Visibility.Visible; NewChat.Visibility = Visibility.Collapsed; } }
/// <summary> /// Callback called when the search on a phone number for a contact has a match /// </summary> private void OnContactFound(object sender, ContactFoundEventArgs e) { if (e.ContactFound != null) { Logger.Msg("[LinphoneManager] Contact found: " + e.ContactFound.DisplayName + "\r\n"); // Store the contact name as display name for call logs if (LinphoneManager.Instance.LinphoneCore.CurrentCall != null) { LinphoneManager.Instance.LinphoneCore.CurrentCall.RemoteAddress.DisplayName = e.ContactFound.DisplayName; } } ContactManager.ContactFound -= OnContactFound; }