]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-contact-dialogs.c
Merge commit 'staz/dnd'
[empathy.git] / libempathy-gtk / empathy-contact-dialogs.c
index 390caa2fbecb000fa0f81b484403396ecb047314..fed8d04cb262a99c97a603627c7aa36394e978af 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <libempathy/empathy-contact-manager.h>
 #include <libempathy/empathy-contact-list.h>
+#include <libempathy/empathy-tp-contact-factory.h>
 #include <libempathy/empathy-utils.h>
 
 #include "empathy-contact-dialogs.h"
@@ -72,8 +73,17 @@ subscription_dialog_response_cb (GtkDialog *dialog,
        contact = empathy_contact_widget_get_contact (contact_widget);
 
        if (response == GTK_RESPONSE_YES) {
+               EmpathyTpContactFactory *factory;
+
+               factory = empathy_tp_contact_factory_dup_singleton (
+                       empathy_contact_get_connection (contact));
+
                empathy_contact_list_add (EMPATHY_CONTACT_LIST (manager),
                                          contact, "");
+               empathy_tp_contact_factory_set_alias (factory, contact,
+                       empathy_contact_widget_get_alias (contact_widget));
+
+               g_object_unref (factory);
        }
        else if (response == GTK_RESPONSE_NO) {
                empathy_contact_list_remove (EMPATHY_CONTACT_LIST (manager),
@@ -117,6 +127,7 @@ empathy_subscription_dialog_show (EmpathyContact *contact,
 
        /* Contact info widget */
        contact_widget = empathy_contact_widget_new (contact,
+                                                    EMPATHY_CONTACT_WIDGET_NO_SET_ALIAS |
                                                     EMPATHY_CONTACT_WIDGET_EDIT_ALIAS |
                                                     EMPATHY_CONTACT_WIDGET_EDIT_GROUPS);
        gtk_box_pack_end (GTK_BOX (hbox_subscription),
@@ -250,7 +261,8 @@ empathy_contact_edit_dialog_show (EmpathyContact *contact,
        /* Contact info widget */
        contact_widget = empathy_contact_widget_new (contact,
                EMPATHY_CONTACT_WIDGET_EDIT_ALIAS |
-               EMPATHY_CONTACT_WIDGET_EDIT_GROUPS);
+               EMPATHY_CONTACT_WIDGET_EDIT_GROUPS |
+               EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE);
        gtk_container_set_border_width (GTK_CONTAINER (contact_widget), 8);
        gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
                            contact_widget,