add callbacks to previsous commit

This commit is contained in:
Benjamin Reis 2016-11-08 10:51:57 +01:00
parent a95e3ce0fe
commit eb35e05943
3 changed files with 25 additions and 3 deletions

View file

@ -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);
}
}

View file

@ -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.

View file

@ -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);