From 97c8f0d0d885a020d98be3a35b6fac4c0736c554 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 5 Aug 2016 15:46:02 +0200 Subject: [PATCH] account_creator.c: fix creation --- coreapi/account_creator.c | 11 ++++++++--- coreapi/friendlist.c | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 4a4bb89a2..1b536983b 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -438,8 +438,13 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr linphone_core_set_firewall_policy(creator->core, LinphonePolicyUseIce); } - info = linphone_auth_info_new(linphone_address_get_username(identity), NULL, creator->password, - creator->password ? NULL : creator->ha1, NULL, linphone_address_get_domain(identity)); + info = linphone_auth_info_new(linphone_address_get_username(identity), // username + NULL, //user id + creator->password, // passwd + creator->password ? NULL : creator->ha1, // ha1 + !creator->password && creator->ha1 ? linphone_address_get_domain(identity) : NULL, // realm - assumed to be domain + linphone_address_get_domain(identity) // domain + ); linphone_core_add_auth_info(creator->core, info); linphone_address_destroy(identity); @@ -541,7 +546,7 @@ static LinphoneXmlRpcRequest * _create_account_with_email(LinphoneAccountCreator LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator) { LinphoneXmlRpcRequest *request; char *identity = _get_identity(creator); - if (!identity || !creator->password || (!(request = _create_account_with_phone(creator)) + if (!identity || (!(request = _create_account_with_phone(creator)) && !(request = _create_account_with_email(creator)))) { if (creator->callbacks->create_account != NULL) { creator->callbacks->create_account(creator, LinphoneAccountCreatorReqFailed); diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 0266ea5f6..00b9e464c 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -635,6 +635,7 @@ LinphoneFriend * linphone_friend_list_find_friend_by_address(const LinphoneFrien bctbx_list_t *phone_numbers = linphone_friend_get_phone_numbers(lf); iterator = phone_numbers; ms_free(uri); + if (!phone_number) return NULL; while (iterator && (result == NULL)) { const char *number = (const char *)bctbx_list_get_data(iterator); if (strcmp(number, phone_number) == 0) result = lf;