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
bd503ea8
Commit
bd503ea8
authored
Jul 11, 2016
by
Gautier Pelloux-Prayer
Browse files
frienlist.c: fix sort (use display name when available)
parent
489c03a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
gtk/friendlist.c
gtk/friendlist.c
+13
-7
mediastreamer2
mediastreamer2
+1
-1
No files found.
gtk/friendlist.c
View file @
bd503ea8
...
...
@@ -611,7 +611,7 @@ static int get_friend_weight(const LinphoneFriend *lf){
}
static
int
friend_compare_func
(
const
LinphoneFriend
*
lf1
,
const
LinphoneFriend
*
lf2
){
int
w1
,
w2
;
int
w1
,
w2
,
ret
;
w1
=
get_friend_weight
(
lf1
);
w2
=
get_friend_weight
(
lf2
);
if
(
w1
==
w2
){
...
...
@@ -619,13 +619,19 @@ static int friend_compare_func(const LinphoneFriend *lf1, const LinphoneFriend *
const
LinphoneAddress
*
addr1
,
*
addr2
;
addr1
=
linphone_friend_get_address
(
lf1
);
addr2
=
linphone_friend_get_address
(
lf2
);
u1
=
linphone_address_get_username
(
addr1
);
u2
=
linphone_address_get_username
(
addr2
);
if
(
u1
&&
u2
)
return
strcasecmp
(
u1
,
u2
);
if
(
u1
)
return
1
;
else
return
-
1
;
u1
=
linphone_address_get_display_name
(
addr1
)
?
linphone_address_get_display_name
(
addr1
)
:
linphone_address_get_username
(
addr1
);
u2
=
linphone_address_get_display_name
(
addr2
)
?
linphone_address_get_display_name
(
addr2
)
:
linphone_address_get_username
(
addr2
);
if
(
u1
&&
u2
)
{
ret
=
strcasecmp
(
u1
,
u2
);
}
else
if
(
u1
)
{
ret
=
1
;
}
else
{
ret
=
-
1
;
}
}
else
{
ret
=
w2
-
w1
;
}
return
w2
-
w1
;
return
ret
;
}
static
bctbx_list_t
*
sort_friend_list
(
const
bctbx_list_t
*
friends
){
...
...
mediastreamer2
@
2f39b407
Subproject commit 2
204eb636cbc05aea0da923881e2ea3bdd795587
Subproject commit 2
f39b407c0291b7b36e8cd061f33d057bf2e1178
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