make sure subscription are not sent if linphonecore is not ready

This commit is contained in:
Jehan Monnier 2016-05-16 10:48:56 +02:00
parent 3d30286f84
commit f51f286803

View file

@ -615,11 +615,16 @@ void linphone_friend_save(LinphoneFriend *fr, LinphoneCore *lc) {
void linphone_friend_apply(LinphoneFriend *fr, LinphoneCore *lc) {
LinphonePresenceModel *model;
if (!fr->uri) {
ms_warning("No sip url defined.");
return;
}
if (!linphone_core_ready(lc)) {
/* lc not ready, deffering subscription */
fr->commit=TRUE;
return;
}
if (fr->inc_subscribe_pending) {
switch(fr->pol) {
@ -693,8 +698,6 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf) {
lc->subscribers = ms_list_remove(lc->subscribers, lf);
linphone_friend_unref(lf);
}
if (linphone_core_ready(lc)) linphone_friend_apply(lf, lc);
else lf->commit = TRUE;
}
void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend *lf) {