diff --git a/Classes/AssistantLinkView.m b/Classes/AssistantLinkView.m index 50ec9adce..e7b218c6f 100644 --- a/Classes/AssistantLinkView.m +++ b/Classes/AssistantLinkView.m @@ -10,11 +10,17 @@ #import #import "AssistantLinkView.h" +#import "UITextField+DoneButton.h" @implementation AssistantLinkView { LinphoneAccountCreator *account_creator; } +- (void)viewDidLoad { + [super viewDidLoad]; + [_activationCodeField addDoneButton]; +} + - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 0ba671027..03c6a67d4 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -391,6 +391,16 @@ static UICompositeViewDescription *compositeDescription = nil; countryButton.layer.cornerRadius = 4.f; countryButton.layer.masksToBounds = YES; + // every UITextField subviews with phone keyboard must be tweaked to have a done button + for (UIView *child in [view subviews]) { + if ([child.class isSubclassOfClass:UITextField.class]) { + UITextField *tf = (UITextField *)child; + if (tf.keyboardType == UIKeyboardTypePhonePad || tf.keyboardType == UIKeyboardTypeNumberPad) { + [tf addDoneButton]; + } + } + } + [self prepareErrorLabels]; } diff --git a/Classes/DialerView.m b/Classes/DialerView.m index db126c028..4da747c72 100644 --- a/Classes/DialerView.m +++ b/Classes/DialerView.m @@ -165,6 +165,11 @@ static UICompositeViewDescription *compositeDescription = nil; _padView.hidden = !IPAD && UIInterfaceOrientationIsLandscape(toInterfaceOrientation); } +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [LinphoneManager.instance shouldPresentLinkPopup]; +} + #pragma mark - Event Functions - (void)callUpdateEvent:(NSNotification *)notif { diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 3de172972..c7e7c38c6 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -186,6 +186,8 @@ typedef struct _LinphoneManagerSounds { + (BOOL)isMyself:(const LinphoneAddress *)addr; +- (void)shouldPresentLinkPopup; + @property (readonly) BOOL isTesting; @property(readonly, strong) FastAddressBook *fastAddressBook; @property Connectivity connectivity; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 7683c8e3f..5b7493423 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1446,8 +1446,6 @@ static LinphoneCoreVTable linphonec_vtable = { [self enableProxyPublish:YES]; - [self shouldPresentLinkPopup]; - LOGI(@"Linphone [%s] started on [%s]", linphone_core_get_version(), [[UIDevice currentDevice].model UTF8String]); // Post event @@ -1538,7 +1536,6 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat } - (void)shouldPresentLinkPopup { - LOGW(@"hello!"); NSDate *nextTime = [NSDate dateWithTimeIntervalSince1970:[self lpConfigIntForKey:@"must_link_account_time" withDefault:1]]; NSDate *now = [NSDate date]; diff --git a/Classes/Utils/Utils.m b/Classes/Utils/Utils.m index 7249b375c..26b04ba6e 100644 --- a/Classes/Utils/Utils.m +++ b/Classes/Utils/Utils.m @@ -461,6 +461,22 @@ LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC); LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(cfg, value.UTF8String); + // first try to find a friend with the given address + Contact *c = [FastAddressBook getContactWithAddress:addr]; + if (c && c.friend) { + LinphoneFriend *f = c.friend; + const LinphonePresenceModel *m = + f ? linphone_friend_get_presence_model_for_uri_or_tel(f, value.UTF8String) : NULL; + const char *contact = m ? linphone_presence_model_get_contact(m) : NULL; + if (contact) { + LinphoneAddress *contact_addr = linphone_address_new(contact); + if (contact_addr) { + linphone_address_destroy(addr); + return contact_addr; + } + } + } + // since user wants to escape plus, we assume it expects to have phone numbers by default if (addr && cfg && linphone_proxy_config_get_dial_escape_plus(cfg)) { char *phone = linphone_proxy_config_normalize_phone_number(cfg, value.UTF8String); diff --git a/submodules/linphone b/submodules/linphone index 9cbccee8d..ee50e0e3c 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 9cbccee8de5686fcfed41717429c4130d13d7ee8 +Subproject commit ee50e0e3c1863bd7924cdcf3f7fd2eb34c886195