From 13e4db5a810be72a92805c5d2c33c5655b9fe73c Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 12 Mar 2013 14:24:45 +0100 Subject: [PATCH] Fix the local notification when receiving a chat message from an email address in background mode. --- Classes/LinphoneManager.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 96217b332..adb9244eb 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -585,11 +585,17 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo ABRecordRef contact = [fastAddressBook getContact:normalizedSipAddress]; if(contact) { address = [FastAddressBook getContactDisplayName:contact]; + } else { + if ([[LinphoneManager instance] lpConfigBoolForKey:@"show_contacts_emails_preference"] == true) { + LinphoneAddress *linphoneAddress = linphone_address_new([normalizedSipAddress cStringUsingEncoding:[NSString defaultCStringEncoding]]); + address = [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)]; + linphone_address_destroy(linphoneAddress); + } } if(address == nil) { address = @"Unknown"; } - + // Create a new notification UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease]; if (notif) {