Commit 26a52290 authored by Simon Morlat's avatar Simon Morlat
Browse files

fix crash in presence unsubscription

parent ede5ab7c
......@@ -295,10 +295,14 @@ int sal_subscribe_presence(SalOp *op, const char *from, const char *to, int expi
return -1;
}
}
if (!op->event){
op->event=belle_sip_header_create("Event","presence");
belle_sip_object_ref(op->event);
}
belle_sip_parameters_remove_parameter(BELLE_SIP_PARAMETERS(op->base.from_address),"tag");
belle_sip_parameters_remove_parameter(BELLE_SIP_PARAMETERS(op->base.to_address),"tag");
req=sal_op_build_request(op,"SUBSCRIBE");
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),belle_sip_header_create("Event","presence"));
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),op->event);
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(belle_sip_header_expires_create(expires)));
return sal_op_send_request(op,req);
......
......@@ -451,11 +451,13 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf)
}
void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend* fl){
MSList *el=ms_list_find(lc->friends,(void *)fl);
MSList *el=ms_list_find(lc->friends,fl);
if (el!=NULL){
linphone_friend_destroy((LinphoneFriend*)el->data);
lc->friends=ms_list_remove_link(lc->friends,el);
linphone_core_write_friends_config(lc);
}else{
ms_error("linphone_core_remove_friend(): friend [%p] is not part of core's list.",fl);
}
}
......
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