Commit 02dfee95 authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer
Browse files

Remove 'registered' member from LinphoneProxyObject

Use more fine-grained 'state' member instead
parent e177c7e7
......@@ -623,12 +623,11 @@ static void register_success(SalOp *op, bool_t registered){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)sal_op_get_user_pointer(op);
char *msg;
cfg->registered=registered;
linphone_proxy_config_set_error(cfg,LinphoneReasonNone);
linphone_proxy_config_set_state(cfg, registered ? LinphoneRegistrationOk : LinphoneRegistrationCleared ,
registered ? "Registration sucessful" : "Unregistration done");
if (lc->vtable.display_status){
if (cfg->registered) msg=ms_strdup_printf(_("Registration on %s successful."),sal_op_get_proxy(op));
if (registered) msg=ms_strdup_printf(_("Registration on %s successful."),sal_op_get_proxy(op));
else msg=ms_strdup_printf(_("Unregistration on %s done."),sal_op_get_proxy(op));
lc->vtable.display_status(lc,msg);
ms_free(msg);
......
......@@ -4164,7 +4164,7 @@ static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t cu
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
if (linphone_proxy_config_register_enabled(cfg) ) {
if (!isReachable) {
cfg->registered=0;
linphone_proxy_config_set_state(cfg, LinphoneRegistrationNone,"Registration impossible (network down)");
}else{
cfg->commit=TRUE;
}
......
......@@ -255,7 +255,6 @@ struct _LinphoneProxyConfig
SalOp *publish_op;
bool_t commit;
bool_t reg_sendregister;
bool_t registered;
bool_t publish;
bool_t dial_escape_plus;
void* user_data;
......
......@@ -84,7 +84,7 @@ void linphone_proxy_config_destroy(LinphoneProxyConfig *obj){
* Returns a boolean indicating that the user is sucessfully registered on the proxy.
**/
bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj){
return obj->registered;
return obj->state == LinphoneRegistrationOk;
}
/**
......@@ -232,9 +232,8 @@ void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val){
void linphone_proxy_config_edit(LinphoneProxyConfig *obj){
if (obj->reg_sendregister){
/* unregister */
if (obj->registered) {
if (obj->state != LinphoneRegistrationNone && obj->state != LinphoneRegistrationCleared) {
sal_unregister(obj->op);
obj->registered=FALSE;
}
}
}
......@@ -301,7 +300,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *obj){
**/
void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj){
if (obj->reg_sendregister && obj->op){
obj->registered=FALSE;
linphone_proxy_config_set_state(obj,LinphoneRegistrationProgress, "Refresh registration");
sal_register_refresh(obj->op,obj->expires);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment