diff --git a/Classes/LinphoneUI/UICallButton.h b/Classes/LinphoneUI/UICallButton.h index 9593c546e..08301ae5c 100644 --- a/Classes/LinphoneUI/UICallButton.h +++ b/Classes/LinphoneUI/UICallButton.h @@ -24,7 +24,6 @@ @private char mDigit; UITextField* mAddress; - UILabel* mDisplayName; } --(void) initWithAddress:(UITextField*) address withDisplayName:(UILabel*) displayName; +-(void) initWithAddress:(UITextField*) address; @end diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index e4ccdceb6..eed2d3fe9 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -53,16 +53,12 @@ } else { char normalizedUserName[256]; NSString* toUserName = [NSString stringWithString:[mAddress text]]; - if ([mDisplayName.text length] <=0) { - NSString* lDisplayName = [[LinphoneManager instance] getDisplayNameFromAddressBook:toUserName andUpdateCallLog:nil]; - if (lDisplayName) { - mDisplayName.text = lDisplayName; - } - } + NSString* lDisplayName = [[LinphoneManager instance] getDisplayNameFromAddressBook:toUserName andUpdateCallLog:nil]; + linphone_proxy_config_normalize_number(proxyCfg,[toUserName cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName)); LinphoneAddress* tmpAddress = linphone_address_new(linphone_core_get_identity([LinphoneManager getLc])); linphone_address_set_username(tmpAddress,normalizedUserName); - linphone_address_set_display_name(tmpAddress,[mDisplayName.text length]>0?[mDisplayName.text cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil); + linphone_address_set_display_name(tmpAddress,(lDisplayName)?[lDisplayName cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil); linphone_call_params_enable_video(lcallParams,startVideo&linphone_core_video_enabled([LinphoneManager getLc])); @@ -85,9 +81,8 @@ // Drawing code. } */ --(void) initWithAddress:(UITextField*) address withDisplayName:(UILabel*) displayName { +-(void) initWithAddress:(UITextField*) address{ mAddress=[address retain]; - mDisplayName = [displayName retain]; [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 3390fd3a3..a0e732f8a 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -92,8 +92,8 @@ [nine initWithNumber:'9' addressField:address dtmf:false]; [star initWithNumber:'*' addressField:address dtmf:false]; [hash initWithNumber:'#' addressField:address dtmf:false]; - [callShort initWithAddress:address withDisplayName:mDisplayName]; - [callLarge initWithAddress:address withDisplayName:mDisplayName]; + [callShort initWithAddress:address]; + [callLarge initWithAddress:address]; [erase initWithAddressField:address]; [backToCallView addTarget:self action:@selector(backToCallViewPressed) forControlEvents:UIControlEventTouchUpInside]; mIncallViewController = [[IncallViewController alloc] initWithNibName:@"IncallViewController"