Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
f5f80c92
Commit
f5f80c92
authored
Apr 22, 2016
by
Sylvain Berfini
🐮
Browse files
Few fixes for when using friends without the database storage
parent
f3e7ce47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
coreapi/friend.c
coreapi/friend.c
+6
-2
coreapi/friendlist.c
coreapi/friendlist.c
+4
-9
coreapi/linphonefriend.h
coreapi/linphonefriend.h
+7
-0
No files found.
coreapi/friend.c
View file @
f5f80c92
...
...
@@ -601,8 +601,13 @@ void linphone_friend_update_subscribes(LinphoneFriend *fr, LinphoneProxyConfig *
}
void
linphone_friend_save
(
LinphoneFriend
*
fr
,
LinphoneCore
*
lc
)
{
if
(
!
lc
)
return
;
#ifdef FRIENDS_SQL_STORAGE_ENABLED
linphone_core_store_friend_in_db
(
lc
,
fr
);
if
(
lc
->
friends_db_file
)
{
linphone_core_store_friend_in_db
(
lc
,
fr
);
}
else
{
linphone_core_write_friends_config
(
lc
);
}
#else
linphone_core_write_friends_config
(
lc
);
#endif
...
...
@@ -690,7 +695,6 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf) {
}
if
(
linphone_core_ready
(
lc
))
linphone_friend_apply
(
lf
,
lc
);
else
lf
->
commit
=
TRUE
;
linphone_friend_save
(
lf
,
lc
);
}
void
linphone_core_remove_friend
(
LinphoneCore
*
lc
,
LinphoneFriend
*
lf
)
{
...
...
coreapi/friendlist.c
View file @
f5f80c92
...
...
@@ -431,9 +431,7 @@ LinphoneFriendListStatus linphone_friend_list_import_friend(LinphoneFriendList *
if
(
synchronize
)
{
list
->
dirty_friends_to_update
=
ms_list_append
(
list
->
dirty_friends_to_update
,
linphone_friend_ref
(
lf
));
}
#ifdef FRIENDS_SQL_STORAGE_ENABLED
linphone_core_store_friend_in_db
(
lf
->
lc
,
lf
);
#endif
linphone_friend_save
(
lf
,
lf
->
lc
);
return
LinphoneFriendListOK
;
}
...
...
@@ -466,6 +464,9 @@ static LinphoneFriendListStatus _linphone_friend_list_remove_friend(LinphoneFrie
}
}
}
if
(
!
list
->
lc
->
friends_db_file
)
{
linphone_core_write_friends_config
(
list
->
lc
);
}
lf
->
friend_list
=
NULL
;
linphone_friend_unref
(
lf
);
...
...
@@ -785,9 +786,6 @@ int linphone_friend_list_import_friends_from_vcard4_file(LinphoneFriendList *lis
}
vcards
=
ms_list_next
(
vcards
);
}
#ifndef FRIENDS_SQL_STORAGE_ENABLED
linphone_core_write_friends_config
(
list
->
lc
);
#endif
return
count
;
}
...
...
@@ -821,9 +819,6 @@ int linphone_friend_list_import_friends_from_vcard4_buffer(LinphoneFriendList *l
}
vcards
=
ms_list_next
(
vcards
);
}
#ifndef FRIENDS_SQL_STORAGE_ENABLED
linphone_core_write_friends_config
(
list
->
lc
);
#endif
return
count
;
}
...
...
coreapi/linphonefriend.h
View file @
f5f80c92
...
...
@@ -519,6 +519,13 @@ LINPHONE_PUBLIC void linphone_core_set_friends_database_path(LinphoneCore *lc, c
**/
LINPHONE_PUBLIC
void
linphone_core_migrate_friends_from_rc_to_db
(
LinphoneCore
*
lc
);
/**
* Saves a friend either in database if configured, otherwise in linphonerc
* @param fr the linphone friend to save
* @param lc the linphone core
*/
void
linphone_friend_save
(
LinphoneFriend
*
fr
,
LinphoneCore
*
lc
);
/**
* @}
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment