mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 15:18:11 +00:00
Fix regression about P2P presence
Denying a friend to subscribe presence was no more possible once we accepted.
This commit is contained in:
parent
605fd462c9
commit
fd9fbedb40
2 changed files with 20 additions and 7 deletions
|
|
@ -464,12 +464,16 @@ void linphone_friend_invalidate_subscription(LinphoneFriend *lf){
|
|||
lf->initial_subscribes_sent=FALSE;
|
||||
}
|
||||
|
||||
void linphone_friend_close_subscriptions(LinphoneFriend *lf){
|
||||
linphone_friend_unsubscribe(lf);
|
||||
static void linphone_friend_close_incoming_subscriptions(LinphoneFriend *lf) {
|
||||
bctbx_list_for_each(lf->insubs, (MSIterateFunc) sal_notify_presence_close);
|
||||
lf->insubs = bctbx_list_free_with_data(lf->insubs, (MSIterateFunc)sal_op_release);
|
||||
}
|
||||
|
||||
void linphone_friend_close_subscriptions(LinphoneFriend *lf){
|
||||
linphone_friend_unsubscribe(lf);
|
||||
linphone_friend_close_incoming_subscriptions(lf);
|
||||
}
|
||||
|
||||
static void _linphone_friend_release_ops(LinphoneFriend *lf){
|
||||
lf->insubs = bctbx_list_free_with_data(lf->insubs, (MSIterateFunc) sal_op_release);
|
||||
if (lf->outsub){
|
||||
|
|
@ -744,6 +748,10 @@ void linphone_friend_apply(LinphoneFriend *fr, LinphoneCore *lc) {
|
|||
}
|
||||
fr->inc_subscribe_pending = FALSE;
|
||||
}
|
||||
|
||||
if (fr->pol == LinphoneSPDeny && fr->insubs) {
|
||||
linphone_friend_close_incoming_subscriptions(fr);
|
||||
}
|
||||
|
||||
linphone_friend_update_subscribes(fr, linphone_core_should_subscribe_friends_only_when_registered(lc));
|
||||
|
||||
|
|
|
|||
|
|
@ -1551,12 +1551,17 @@ void linphone_subscription_new(LinphoneCore *lc, SalOp *op, const char *from){
|
|||
/* check if we answer to this subscription */
|
||||
lf = linphone_core_find_friend(lc, uri);
|
||||
if (lf!=NULL){
|
||||
linphone_friend_add_incoming_subscription(lf, op);
|
||||
lf->inc_subscribe_pending=TRUE;
|
||||
if (lp_config_get_int(lc->config,"sip","notify_pending_state",0)) {
|
||||
sal_notify_pending_state(op);
|
||||
if (lf->pol != LinphoneSPDeny) {
|
||||
linphone_friend_add_incoming_subscription(lf, op);
|
||||
lf->inc_subscribe_pending=TRUE;
|
||||
if (lp_config_get_int(lc->config,"sip","notify_pending_state",0)) {
|
||||
sal_notify_pending_state(op);
|
||||
}
|
||||
sal_subscribe_accept(op);
|
||||
} else {
|
||||
ms_message("%s is not authorized to subscribe", from);
|
||||
sal_subscribe_decline(op, SalReasonDeclined);
|
||||
}
|
||||
sal_subscribe_accept(op);
|
||||
linphone_friend_done(lf); /*this will do all necessary actions */
|
||||
}else{
|
||||
/* check if this subscriber is in our black list */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue