forked from mirrors/linphone-iphone
Fix incorrect display names used
This commit is contained in:
parent
e6ecdc71a3
commit
26eaffe005
3 changed files with 7 additions and 13 deletions
|
|
@ -24,7 +24,6 @@
|
|||
@private
|
||||
char mDigit;
|
||||
UITextField* mAddress;
|
||||
UILabel* mDisplayName;
|
||||
}
|
||||
-(void) initWithAddress:(UITextField*) address withDisplayName:(UILabel*) displayName;
|
||||
-(void) initWithAddress:(UITextField*) address;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue