From eb35e05943224a86cd9d3db2551ff0410e9ecffa Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 8 Nov 2016 10:51:57 +0100 Subject: [PATCH] add callbacks to previsous commit --- coreapi/account_creator.c | 12 ++++++++++-- coreapi/account_creator.h | 14 ++++++++++++++ coreapi/private.h | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 8072dc7f4..d2071e6b3 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -61,6 +61,14 @@ void linphone_account_creator_cbs_set_user_data(LinphoneAccountCreatorCbs *cbs, cbs->user_data = ud; } +void *linphone_account_creator_cbs_get_update_hash(const LinphoneAccountCreatorCbs *cbs) { + return cbs->update_hash; +} + +void linphone_account_creator_cbs_set_update_hash(LinphoneAccountCreatorCbs *cbs, void *ud) { + cbs->update_hash = ud; +} + LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_used(const LinphoneAccountCreatorCbs *cbs) { return cbs->is_account_used; } @@ -369,7 +377,7 @@ const char * linphone_account_creator_get_password(const LinphoneAccountCreator LinphoneAccountCreator _password_updated_cb(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); - if (creator->callbacks->password_updated != NULL) { + if (creator->callbacks->update_hash != NULL) { LinphoneAccountCreatorStatus status = LinphoneAccountCreatorReqFailed; const char* resp = linphone_xml_rpc_request_get_string_response(request); if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { @@ -381,7 +389,7 @@ LinphoneAccountCreator _password_updated_cb(LinphoneXmlRpcRequest *request) { status = LinphoneAccountCreatorErrorServer; } } - creator->callbacks->password_updated(creator, status, resp); + creator->callbacks->update_hash(creator, status, resp); } } diff --git a/coreapi/account_creator.h b/coreapi/account_creator.h index a8aa2c210..b52f715dd 100644 --- a/coreapi/account_creator.h +++ b/coreapi/account_creator.h @@ -387,6 +387,20 @@ LINPHONE_PUBLIC void *linphone_account_creator_cbs_get_user_data(const LinphoneA **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_user_data(LinphoneAccountCreatorCbs *cbs, void *ud); +/** + * Retrieve the user pointer associated with a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. + * @return The user pointer associated with the LinphoneAccountCreatorCbs object. +**/ +LINPHONE_PUBLIC void *linphone_account_creator_cbs_get_update_hash(const LinphoneAccountCreatorCbs *cbs); + +/** + * Assign a user pointer to a LinphoneAccountCreatorCbs object. + * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] ud The user pointer to associate with the LinphoneAccountCreatorCbs object. +**/ +LINPHONE_PUBLIC void linphone_account_creator_cbs_set_update_hash(LinphoneAccountCreatorCbs *cbs, void *ud); + /** * Get the current linked tested callback. * @param[in] cbs LinphoneAccountCreatorCbs object. diff --git a/coreapi/private.h b/coreapi/private.h index ec4c955e6..432b63fc8 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -1342,7 +1342,7 @@ struct _LinphoneAccountCreatorCbs { LinphoneAccountCreatorCbsStatusCb activate_phone_number_link; LinphoneAccountCreatorCbsStatusCb recover_phone_account; LinphoneAccountCreatorCbsStatusCb is_account_linked; - LinphoneAccountCreatorCbsStatusCb password_updated; + LinphoneAccountCreatorCbsStatusCb update_hash; }; BELLE_SIP_DECLARE_VPTR(LinphoneAccountCreatorCbs);