Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
de7a4306
Commit
de7a4306
authored
Nov 28, 2016
by
Benjamin REIS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not crash if friend whith no LC but show an error
parent
717ea1ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
coreapi/friend.c
coreapi/friend.c
+5
-2
coreapi/friendlist.c
coreapi/friendlist.c
+1
-0
No files found.
coreapi/friend.c
View file @
de7a4306
...
...
@@ -108,13 +108,16 @@ static int friend_compare(const void * a, const void * b) {
}
static
LinphoneFriendPresence
*
find_presence_model_for_uri_or_tel
(
const
LinphoneFriend
*
lf
,
const
char
*
uri_or_tel
)
{
bctbx_list_t
*
iterator
=
lf
->
presence_models
;
LinphoneAddress
*
uri_or_tel_addr
=
linphone_core_interpret_url
(
lf
->
lc
,
uri_or_tel
)
;
bctbx_list_t
*
iterator
=
NULL
;
LinphoneAddress
*
uri_or_tel_addr
=
NULL
;
LinphoneFriendPresence
*
result
=
NULL
;
if
(
!
lf
->
lc
)
{
ms_warning
(
"Cannot find uri of tel [%s] from friend [%p] because not associated to any Linphone core object"
,
uri_or_tel
,
lf
);
return
NULL
;
}
iterator
=
lf
->
presence_models
;
uri_or_tel_addr
=
linphone_core_interpret_url
(
lf
->
lc
,
uri_or_tel
);
while
(
uri_or_tel_addr
&&
iterator
)
{
LinphoneFriendPresence
*
lfp
=
(
LinphoneFriendPresence
*
)
bctbx_list_get_data
(
iterator
);
LinphoneAddress
*
lfp_addr
=
linphone_core_interpret_url
(
lf
->
lc
,
lfp
->
uri_or_tel
);
...
...
coreapi/friendlist.c
View file @
de7a4306
...
...
@@ -706,6 +706,7 @@ LinphoneFriend * linphone_friend_list_find_friend_by_uri(const LinphoneFriendLis
LinphoneFriend
*
linphone_friend_list_find_friend_by_ref_key
(
const
LinphoneFriendList
*
list
,
const
char
*
ref_key
)
{
const
bctbx_list_t
*
elem
;
if
(
ref_key
==
NULL
)
return
NULL
;
if
(
list
==
NULL
)
return
NULL
;
for
(
elem
=
list
->
friends
;
elem
!=
NULL
;
elem
=
bctbx_list_next
(
elem
))
{
LinphoneFriend
*
lf
=
(
LinphoneFriend
*
)
bctbx_list_get_data
(
elem
);
if
((
lf
->
refkey
!=
NULL
)
&&
(
strcmp
(
lf
->
refkey
,
ref_key
)
==
0
))
return
lf
;
...
...
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