From 7895036464b415faba4d00febb5911dd222f6c01 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Mon, 15 Apr 2019 17:02:59 +0200 Subject: [PATCH] set addressLabel in CallView --- Classes/Utils/Utils.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Classes/Utils/Utils.m b/Classes/Utils/Utils.m index 7e2bf3158..42533f69f 100644 --- a/Classes/Utils/Utils.m +++ b/Classes/Utils/Utils.m @@ -641,17 +641,23 @@ + (void)setDisplayNameLabel:(UILabel *)label forAddress:(const LinphoneAddress *)addr withAddressLabel:(UILabel*)addressLabel{ Contact *contact = [FastAddressBook getContactWithAddress:addr]; + NSString *tmpAddress = nil; if (contact) { [ContactDisplay setDisplayNameLabel:label forContact:contact]; - addressLabel.text = [NSString stringWithUTF8String:linphone_address_as_string_uri_only(addr)]; + tmpAddress = [NSString stringWithUTF8String:linphone_address_as_string_uri_only(addr)]; addressLabel.hidden = FALSE; } else { label.text = [FastAddressBook displayNameForAddress:addr]; if([LinphoneManager.instance lpConfigBoolForKey:@"display_phone_only" inSection:@"app"]) addressLabel.hidden = TRUE; else - addressLabel.text = [NSString stringWithUTF8String:linphone_address_as_string_uri_only(addr)]; + tmpAddress = [NSString stringWithUTF8String:linphone_address_as_string_uri_only(addr)]; } + NSRange range = [tmpAddress rangeOfString:@";"]; + if (range.location != NSNotFound) { + tmpAddress = [tmpAddress substringToIndex:range.location]; + } + addressLabel.text = tmpAddress; }