Commit 347b308d authored by Simon Morlat's avatar Simon Morlat
Browse files

improve buddy matching

parent 4fa2a209
...@@ -68,31 +68,11 @@ const char *linphone_online_status_to_string(LinphoneOnlineStatus ss){ ...@@ -68,31 +68,11 @@ const char *linphone_online_status_to_string(LinphoneOnlineStatus ss){
return str; return str;
} }
static int friend_data_compare(const void * a, const void * b, void * data){ static int friend_compare(const void * a, const void * b){
LinphoneAddress *fa=((LinphoneFriend*)a)->uri; LinphoneAddress *fa=((LinphoneFriend*)a)->uri;
LinphoneAddress *fb=((LinphoneFriend*)b)->uri; LinphoneAddress *fb=((LinphoneFriend*)b)->uri;
const char *ua,*ub; if (linphone_address_weak_equal (fa,fb)) return 0;
ua=linphone_address_get_username(fa); return 1;
ub=linphone_address_get_username(fb);
if (ua!=NULL && ub!=NULL) {
//printf("Comparing usernames %s,%s\n",ua,ub);
return strcasecmp(ua,ub);
}
else {
/* compare hosts*/
ua=linphone_address_get_domain(fa);
ub=linphone_address_get_domain(fb);
if (ua!=NULL && ub!=NULL){
int ret=strcasecmp(ua,ub);
//printf("Comparing hostnames %s,%s,res=%i\n",ua,ub,ret);
return ret;
}
else return -1;
}
}
static int friend_compare(const void * a, const void * b){
return friend_data_compare(a,b,NULL);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="title" translatable="yes">Linphone debug window</property> <property name="title" translatable="yes">Linphone debug window</property>
<property name="window_position">center-on-parent</property> <property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property> <property name="type_hint">normal</property>
<property name="deletable">False</property> <property name="deletable">False</property>
<property name="has_separator">False</property> <property name="has_separator">False</property>
<signal name="response" handler="gtk_widget_hide"/> <signal name="response" handler="gtk_widget_hide"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment