Commit 77de34fe authored by smorlat's avatar smorlat

add "use_subscribe_notify" property in GtkUi config items to control whether...

add "use_subscribe_notify" property in GtkUi config items to control whether subscribes should be send and accepted.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@741 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 27cf8b20
......@@ -279,9 +279,13 @@ void linphone_gtk_add_buddy_from_database(GtkWidget *button){
char *name;
char *addr;
LinphoneFriend *lf;
int presence=linphone_gtk_get_ui_config_int("use_subscribe_notify",1);
gtk_tree_model_get (model, &iter,LOOKUP_RESULT_SIP_URI , &uri,LOOKUP_RESULT_NAME, &name, -1);
addr=g_strdup_printf("%s <%s>",name,uri);
lf=linphone_friend_new_with_addr(addr);
linphone_friend_set_inc_subscribe_policy(lf,presence ? LinphoneSPAccept : LinphoneSPDeny);
linphone_friend_send_subscribe(lf,presence);
linphone_core_add_friend(linphone_gtk_get_core(),lf);
linphone_gtk_show_friends();
g_free(addr);
......
......@@ -352,6 +352,11 @@ void linphone_gtk_show_friends(void){
void linphone_gtk_add_contact(void){
GtkWidget *w=linphone_gtk_create_window("contact");
int presence_enabled=linphone_gtk_get_ui_config_int("use_subscribe_notify",1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(w,"show_presence")),presence_enabled);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(w,"allow_presence")),
presence_enabled);
gtk_widget_show(w);
}
......@@ -430,10 +435,16 @@ void linphone_gtk_contact_ok(GtkWidget *button){
GtkWidget *w=gtk_widget_get_toplevel(button);
LinphoneFriend *lf=(LinphoneFriend*)g_object_get_data(G_OBJECT(w),"friend_ref");
char *fixed_uri=NULL;
gboolean show_presence,allow_presence;
gboolean show_presence=FALSE,allow_presence=FALSE;
const gchar *name,*uri;
if (lf==NULL){
lf=linphone_friend_new();
if (linphone_gtk_get_ui_config_int("use_subscribe_notify",1)==1){
show_presence=FALSE;
allow_presence=FALSE;
}
linphone_friend_set_inc_subscribe_policy(lf,allow_presence ? LinphoneSPAccept : LinphoneSPDeny);
linphone_friend_send_subscribe(lf,show_presence);
}
name=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(w,"name")));
uri=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(w,"sip_address")));
......
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