Commit 60802389 authored by Ghislain MARY's avatar Ghislain MARY

Change the account creator API so that it is wrapper-friendly.

parent 18141ff1
......@@ -52,7 +52,7 @@ set(LINPHONE_PRIVATE_HEADER_FILES
set(LINPHONE_SOURCE_FILES_C
account_creator.c
account_creator_request_engine.c
account_creator_service.c
address.c
authentication.c
bellesip_sal/sal_address_impl.c
......
......@@ -26,7 +26,7 @@ lib_LTLIBRARIES=liblinphone.la
liblinphone_la_SOURCES=\
account_creator.c \
account_creator_request_engine.c \
account_creator_service.c \
address.c \
authentication.c \
buffer.c \
......
This diff is collapsed.
/*
account_creator_request_engine.c
Copyright (C) 2017 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "linphone/account_creator_request_engine.h"
#include "linphone/core.h"
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorRequestCbs);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorRequestCbs, belle_sip_object_t,
NULL, // destroy
NULL, // clone
NULL, // marshal
FALSE
);
/************************** Start Account Creator requests_cbs **************************/
LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_new(void) {
return belle_sip_object_new(LinphoneAccountCreatorRequestCbs);
}
LinphoneAccountCreatorRequestCbs * linphone_account_creator_requests_cbs_ref(LinphoneAccountCreatorRequestCbs *requests_cbs) {
belle_sip_object_ref(requests_cbs);
return requests_cbs;
}
void linphone_account_creator_requests_cbs_unref(LinphoneAccountCreatorRequestCbs *requests_cbs) {
belle_sip_object_unref(requests_cbs);
}
void *linphone_account_creator_requests_cbs_get_user_data(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->user_data;
}
void linphone_account_creator_requests_cbs_set_user_data(LinphoneAccountCreatorRequestCbs *requests_cbs, void *ud) {
requests_cbs->user_data = ud;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_constructor_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->account_creator_request_constructor_cb;
}
void linphone_account_creator_requests_cbs_set_constructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->account_creator_request_constructor_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_destructor_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->account_creator_request_destructor_cb;
}
void linphone_account_creator_requests_cbs_set_destructor_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->account_creator_request_destructor_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_create_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->create_account_request_cb;
}
void linphone_account_creator_requests_cbs_set_create_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->create_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_exist_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->is_account_exist_request_cb;
}
void linphone_account_creator_requests_cbs_set_is_account_exist_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->is_account_exist_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->activate_account_request_cb;
}
void linphone_account_creator_requests_cbs_set_activate_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->activate_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_activated_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->is_account_activated_request_cb;
}
void linphone_account_creator_requests_cbs_set_is_account_activated_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->is_account_activated_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_link_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->link_account_request_cb;
}
void linphone_account_creator_requests_cbs_set_link_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->link_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_activate_alias_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->activate_alias_request_cb;
}
void linphone_account_creator_requests_cbs_set_activate_alias_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->activate_alias_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_alias_used_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->is_alias_used_request_cb;
}
void linphone_account_creator_requests_cbs_set_is_alias_used_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->is_alias_used_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_is_account_linked_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->is_account_linked_request_cb;
}
void linphone_account_creator_requests_cbs_set_is_account_linked_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->is_account_linked_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_recover_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->is_account_linked_request_cb;
}
void linphone_account_creator_requests_cbs_set_recover_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->recover_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_requests_cbs_get_update_account_cb(const LinphoneAccountCreatorRequestCbs *requests_cbs) {
return requests_cbs->update_account_request_cb;
}
void linphone_account_creator_requests_cbs_set_update_account_cb(LinphoneAccountCreatorRequestCbs *requests_cbs, LinphoneAccountCreatorRequestFunc cb) {
requests_cbs->update_account_request_cb = cb;
}
/************************** End Account Creator requests_cbs **************************/
void linphone_core_set_account_creator_request_engine_cbs(LinphoneCore *lc, LinphoneAccountCreatorRequestCbs *cbs) {
if (lc->default_ac_request_cbs)
linphone_account_creator_requests_cbs_unref(lc->default_ac_request_cbs);
lc->default_ac_request_cbs = cbs;
}
LinphoneAccountCreatorRequestCbs* linphone_core_get_account_creator_request_engine_cbs(LinphoneCore *lc) {
return lc->default_ac_request_cbs;
}
/*
account_creator_service.c
Copyright (C) 2017 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "linphone/account_creator_service.h"
#include "linphone/core.h"
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorService);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorService, belle_sip_object_t,
NULL, // destroy
NULL, // clone
NULL, // marshal
FALSE
);
/************************** Start Account Creator service **************************/
LinphoneAccountCreatorService * linphone_account_creator_service_new(void) {
return belle_sip_object_new(LinphoneAccountCreatorService);
}
LinphoneAccountCreatorService * linphone_account_creator_service_ref(LinphoneAccountCreatorService *service) {
belle_sip_object_ref(service);
return service;
}
void linphone_account_creator_service_unref(LinphoneAccountCreatorService *service) {
belle_sip_object_unref(service);
}
void *linphone_account_creator_service_get_user_data(const LinphoneAccountCreatorService *service) {
return service->user_data;
}
void linphone_account_creator_service_set_user_data(LinphoneAccountCreatorService *service, void *ud) {
service->user_data = ud;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_constructor_cb(const LinphoneAccountCreatorService *service) {
return service->account_creator_service_constructor_cb;
}
void linphone_account_creator_service_set_constructor_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->account_creator_service_constructor_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_destructor_cb(const LinphoneAccountCreatorService *service) {
return service->account_creator_service_destructor_cb;
}
void linphone_account_creator_service_set_destructor_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->account_creator_service_destructor_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_create_account_cb(const LinphoneAccountCreatorService *service) {
return service->create_account_request_cb;
}
void linphone_account_creator_service_set_create_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->create_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_exist_cb(const LinphoneAccountCreatorService *service) {
return service->is_account_exist_request_cb;
}
void linphone_account_creator_service_set_is_account_exist_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->is_account_exist_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_account_cb(const LinphoneAccountCreatorService *service) {
return service->activate_account_request_cb;
}
void linphone_account_creator_service_set_activate_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->activate_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_activated_cb(const LinphoneAccountCreatorService *service) {
return service->is_account_activated_request_cb;
}
void linphone_account_creator_service_set_is_account_activated_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->is_account_activated_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_link_account_cb(const LinphoneAccountCreatorService *service) {
return service->link_account_request_cb;
}
void linphone_account_creator_service_set_link_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->link_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_alias_cb(const LinphoneAccountCreatorService *service) {
return service->activate_alias_request_cb;
}
void linphone_account_creator_service_set_activate_alias_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->activate_alias_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_alias_used_cb(const LinphoneAccountCreatorService *service) {
return service->is_alias_used_request_cb;
}
void linphone_account_creator_service_set_is_alias_used_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->is_alias_used_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_linked_cb(const LinphoneAccountCreatorService *service) {
return service->is_account_linked_request_cb;
}
void linphone_account_creator_service_set_is_account_linked_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->is_account_linked_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_recover_account_cb(const LinphoneAccountCreatorService *service) {
return service->is_account_linked_request_cb;
}
void linphone_account_creator_service_set_recover_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->recover_account_request_cb = cb;
}
LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_update_account_cb(const LinphoneAccountCreatorService *service) {
return service->update_account_request_cb;
}
void linphone_account_creator_service_set_update_account_cb(LinphoneAccountCreatorService *service, LinphoneAccountCreatorRequestFunc cb) {
service->update_account_request_cb = cb;
}
/************************** End Account Creator service **************************/
void linphone_core_set_account_creator_service(LinphoneCore *lc, LinphoneAccountCreatorService *service) {
if (lc->default_ac_service)
linphone_account_creator_service_unref(lc->default_ac_service);
lc->default_ac_service = service;
}
LinphoneAccountCreatorService * linphone_core_get_account_creator_service(LinphoneCore *lc) {
return lc->default_ac_service;
}
......@@ -2080,21 +2080,21 @@ static void linphone_core_internal_subscription_state_changed(LinphoneCore *lc,
}
}
static void _linphone_core_init_account_creator_request_cbs(LinphoneCore *lc) {
LinphoneAccountCreatorRequestCbs *cbs = linphone_account_creator_requests_cbs_new();
cbs->account_creator_request_constructor_cb = linphone_account_creator_constructor_custom;
cbs->account_creator_request_destructor_cb = NULL;
cbs->create_account_request_cb = linphone_account_creator_create_account_custom;
cbs->is_account_exist_request_cb = linphone_account_creator_is_account_exist_custom;
cbs->activate_account_request_cb = linphone_account_creator_activate_account_custom;
cbs->is_account_activated_request_cb = linphone_account_creator_is_account_activated_custom;
cbs->link_account_request_cb = linphone_account_creator_link_phone_number_with_account_custom;
cbs->activate_alias_request_cb = linphone_account_creator_activate_phone_number_link_custom;
cbs->is_alias_used_request_cb = linphone_account_creator_is_phone_number_used_custom;
cbs->is_account_linked_request_cb = linphone_account_creator_is_account_linked_custom;
cbs->recover_account_request_cb = linphone_account_creator_recover_phone_account_custom;
cbs->update_account_request_cb = linphone_account_creator_update_password_custom;
linphone_core_set_account_creator_request_engine_cbs(lc, cbs);
static void _linphone_core_init_account_creator_service(LinphoneCore *lc) {
LinphoneAccountCreatorService *service = linphone_account_creator_service_new();
service->account_creator_service_constructor_cb = linphone_account_creator_constructor_linphone;
service->account_creator_service_destructor_cb = NULL;
service->create_account_request_cb = linphone_account_creator_create_account_linphone;
service->is_account_exist_request_cb = linphone_account_creator_is_account_exist_linphone;
service->activate_account_request_cb = linphone_account_creator_activate_account_linphone;
service->is_account_activated_request_cb = linphone_account_creator_is_account_activated_linphone;
service->link_account_request_cb = linphone_account_creator_link_phone_number_with_account_linphone;
service->activate_alias_request_cb = linphone_account_creator_activate_phone_number_link_linphone;
service->is_alias_used_request_cb = linphone_account_creator_is_phone_number_used_linphone;
service->is_account_linked_request_cb = linphone_account_creator_is_account_linked_linphone;
service->recover_account_request_cb = linphone_account_creator_recover_phone_account_linphone;
service->update_account_request_cb = linphone_account_creator_update_password_linphone;
linphone_core_set_account_creator_service(lc, service);
}
static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig *config, void * userdata){
......@@ -2112,7 +2112,7 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig
linphone_task_list_init(&lc->hooks);
_linphone_core_init_account_creator_request_cbs(lc);
_linphone_core_init_account_creator_service(lc);
linphone_core_cbs_set_notify_received(internal_cbs, linphone_core_internal_notify_received);
linphone_core_cbs_set_subscription_state_changed(internal_cbs, linphone_core_internal_subscription_state_changed);
......@@ -5763,8 +5763,8 @@ static void linphone_core_uninit(LinphoneCore *lc)
if (lc->im_encryption_engine) {
linphone_im_encryption_engine_unref(lc->im_encryption_engine);
}
if (lc->default_ac_request_cbs) {
linphone_account_creator_requests_cbs_unref(lc->default_ac_request_cbs);
if (lc->default_ac_service) {
linphone_account_creator_service_unref(lc->default_ac_service);
}
linphone_core_free_payload_types(lc);
......
......@@ -8188,15 +8188,15 @@ extern "C" void Java_org_linphone_core_LinphoneXmlRpcSessionImpl_sendRequest(JNI
// Account creator
static void account_creator_is_account_used(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_is_account_used(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
ms_error("cannot attach VM\n");
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8213,7 +8213,7 @@ static void account_creator_is_account_used(LinphoneAccountCreator *creator, Lin
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_create_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_create_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8221,8 +8221,8 @@ static void account_creator_create_account(LinphoneAccountCreator *creator, Linp
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8239,7 +8239,7 @@ static void account_creator_create_account(LinphoneAccountCreator *creator, Linp
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_activate_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_activate_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8247,8 +8247,8 @@ static void account_creator_activate_account(LinphoneAccountCreator *creator, Li
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8265,7 +8265,7 @@ static void account_creator_activate_account(LinphoneAccountCreator *creator, Li
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_link_phone_number_with_account(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_link_phone_number_with_account(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8273,8 +8273,8 @@ static void account_creator_link_phone_number_with_account(LinphoneAccountCreato
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8291,7 +8291,7 @@ static void account_creator_link_phone_number_with_account(LinphoneAccountCreato
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_activate_phone_number_link(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_activate_phone_number_link(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8299,8 +8299,8 @@ static void account_creator_activate_phone_number_link(LinphoneAccountCreator *c
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8317,7 +8317,7 @@ static void account_creator_activate_phone_number_link(LinphoneAccountCreator *c
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_is_account_linked(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8325,8 +8325,8 @@ static void account_creator_is_account_linked(LinphoneAccountCreator *creator, L
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8343,7 +8343,7 @@ static void account_creator_is_account_linked(LinphoneAccountCreator *creator, L
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8351,8 +8351,8 @@ static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8369,7 +8369,7 @@ static void account_creator_is_phone_number_used(LinphoneAccountCreator *creator
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_is_account_activated(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_is_account_activated(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8377,8 +8377,8 @@ static void account_creator_is_account_activated(LinphoneAccountCreator *creator
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8395,7 +8395,7 @@ static void account_creator_is_account_activated(LinphoneAccountCreator *creator
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_phone_account_recovered(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_phone_account_recovered(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8403,8 +8403,8 @@ static void account_creator_phone_account_recovered(LinphoneAccountCreator *crea
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8421,7 +8421,7 @@ static void account_creator_phone_account_recovered(LinphoneAccountCreator *crea
env->CallVoidMethod(listener, method, getAccountCreator(env, creator), statusObject);
}
static void account_creator_password_updated(LinphoneAccountCreator *creator, LinphoneRequestStatus status, const char *resp) {
static void account_creator_password_updated(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char *resp) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
......@@ -8429,8 +8429,8 @@ static void account_creator_password_updated(LinphoneAccountCreator *creator, Li
return;
}
LinphoneAccountCreatorResponseCbs *cbs = linphone_account_creator_get_responses_cbs(creator);
jobject listener = (jobject) linphone_account_creator_responses_cbs_get_user_data(cbs);
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
jobject listener = (jobject) linphone_account_creator_cbs_get_user_data(cbs);
if (listener == NULL) {
ms_error("account_creator_response() notification without listener");
return ;
......@@ -8463,26 +8463,26 @@ extern "C" void Java_org_linphone_core_LinphoneAccountCreatorImpl_unref(JNIEnv *
extern "C" void Java_org_linphone_core_LinphoneAccountCreatorImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) {
LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr;
jobject listener = env->NewGlobalRef(jlistener);
LinphoneAccountCreatorResponseCbs *cbs;
cbs = linphone_account_creator_get_responses_cbs(account_creator);