Commit e8898a1a authored by smorlat's avatar smorlat
Browse files

fix several UI bugs with buddylookup

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@760 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 96b9e2ed
...@@ -1095,8 +1095,10 @@ static void linphone_core_grab_buddy_infos(LinphoneCore *lc, LinphoneProxyConfig ...@@ -1095,8 +1095,10 @@ static void linphone_core_grab_buddy_infos(LinphoneCore *lc, LinphoneProxyConfig
if (linphone_core_lookup_known_proxy(lc,url)==cfg){ if (linphone_core_lookup_known_proxy(lc,url)==cfg){
if (lf->url->url->username!=NULL && lf->url->url->username[0]!='0'){ if (lf->url->url->username!=NULL && lf->url->url->username[0]!='0'){
BuddyLookupRequest *req; BuddyLookupRequest *req;
char tmp[255];
snprintf(tmp,sizeof(tmp),"sip:%s@%s",lf->url->url->username,lf->url->url->host);
req=sip_setup_context_create_buddy_lookup_request(ctx); req=sip_setup_context_create_buddy_lookup_request(ctx);
buddy_lookup_request_set_key(req,lf->url->url->username); buddy_lookup_request_set_key(req,tmp);
buddy_lookup_request_set_max_results(req,1); buddy_lookup_request_set_max_results(req,1);
sip_setup_context_buddy_lookup_submit(ctx,req); sip_setup_context_buddy_lookup_submit(ctx,req);
lc->bl_reqs=ms_list_append(lc->bl_reqs,req); lc->bl_reqs=ms_list_append(lc->bl_reqs,req);
......
...@@ -143,9 +143,13 @@ static gboolean linphone_gtk_process_buddy_lookup(GtkWidget *w){ ...@@ -143,9 +143,13 @@ static gboolean linphone_gtk_process_buddy_lookup(GtkWidget *w){
ctx=(SipSetupContext*)g_object_get_data(G_OBJECT(w),"SipSetupContext"); ctx=(SipSetupContext*)g_object_get_data(G_OBJECT(w),"SipSetupContext");
last_state=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"last_state")); last_state=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"last_state"));
if (req==NULL) return FALSE; if (req==NULL) {
g_object_set_data(G_OBJECT(w),"buddylookup_processing",GINT_TO_POINTER(0));
return FALSE;
}
bls=req->status; bls=req->status;
if (last_state==bls) return TRUE; if (last_state==bls) return TRUE;
switch(bls){ switch(bls){
case BuddyLookupNone: case BuddyLookupNone:
gtk_progress_bar_set_fraction(pb,0); gtk_progress_bar_set_fraction(pb,0);
......
...@@ -272,7 +272,8 @@ void linphone_gtk_directory_search_activate(GtkWidget *entry){ ...@@ -272,7 +272,8 @@ void linphone_gtk_directory_search_activate(GtkWidget *entry){
LinphoneProxyConfig *cfg; LinphoneProxyConfig *cfg;
linphone_core_get_default_proxy(linphone_gtk_get_core(),&cfg); linphone_core_get_default_proxy(linphone_gtk_get_core(),&cfg);
GtkWidget *w=linphone_gtk_show_buddy_lookup_window(linphone_proxy_config_get_sip_setup_context(cfg)); GtkWidget *w=linphone_gtk_show_buddy_lookup_window(linphone_proxy_config_get_sip_setup_context(cfg));
linphone_gtk_buddy_lookup_set_keyword(w,gtk_entry_get_text(GTK_ENTRY(entry))); if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(entry),"active"))==1)
linphone_gtk_buddy_lookup_set_keyword(w,gtk_entry_get_text(GTK_ENTRY(entry)));
} }
void linphone_gtk_directory_search_button_clicked(GtkWidget *button){ void linphone_gtk_directory_search_button_clicked(GtkWidget *button){
......
...@@ -706,6 +706,12 @@ static void linphone_gtk_new_subscriber_response(GtkWidget *dialog, guint respon ...@@ -706,6 +706,12 @@ static void linphone_gtk_new_subscriber_response(GtkWidget *dialog, guint respon
static void linphone_gtk_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, const char *url){ static void linphone_gtk_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, const char *url){
GtkWidget *dialog; GtkWidget *dialog;
if (linphone_gtk_get_ui_config_int("subscribe_deny_all",0)){
linphone_core_reject_subscriber(linphone_gtk_get_core(),lf);
return;
}
gchar *message=g_strdup_printf(_("%s would like to add you to his contact list.\nWould you allow him to see your presence status or add him to your contact list ?\nIf you answer no, this person will be temporarily blacklisted."),url); gchar *message=g_strdup_printf(_("%s would like to add you to his contact list.\nWould you allow him to see your presence status or add him to your contact list ?\nIf you answer no, this person will be temporarily blacklisted."),url);
dialog = gtk_message_dialog_new ( dialog = gtk_message_dialog_new (
GTK_WINDOW(linphone_gtk_get_main_window()), GTK_WINDOW(linphone_gtk_get_main_window()),
......
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