diff --git a/coreapi/bellesip_sal/sal_op_presence.c b/coreapi/bellesip_sal/sal_op_presence.c index 5ea4cfe7b..eef7d3916 100644 --- a/coreapi/bellesip_sal/sal_op_presence.c +++ b/coreapi/bellesip_sal/sal_op_presence.c @@ -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); diff --git a/coreapi/friend.c b/coreapi/friend.c index d045f4c46..7b685a408 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -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); } }