]> git.0d.be Git - empathy.git/commitdiff
Support to tag contact as favorite using DnD
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 10 Mar 2010 12:26:50 +0000 (13:26 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Mar 2010 08:28:42 +0000 (09:28 +0100)
libempathy-gtk/empathy-contact-list-view.c

index e5638954f52ff4e048a86645abf42461baf6152a..9412079128735d1ff486916909445f20a8748d0b 100644 (file)
@@ -238,6 +238,13 @@ contact_list_view_drag_got_contact (EmpathyTpContactFactory *factory,
                data->old_group, data->new_group);
 
        list = empathy_contact_list_store_get_list_iface (priv->store);
+
+       if (!tp_strdiff (data->new_group, EMPATHY_CONTACT_LIST_STORE_FAVORITE)) {
+               /* Mark contact as favourite */
+               empathy_contact_list_add_to_favourites (list, contact);
+               return;
+       }
+
        if (data->new_group) {
                empathy_contact_list_add_to_group (list, contact, data->new_group);
        }
@@ -274,8 +281,10 @@ contact_list_view_contact_drag_received (GtkWidget         *view,
        new_group = empathy_contact_list_store_get_parent_group (model,
                                                                 path, NULL, &is_fake_group);
 
-       if (is_fake_group)
-               /* Fake groups can't be modified */
+       if (is_fake_group &&
+                       tp_strdiff (new_group, EMPATHY_CONTACT_LIST_STORE_FAVORITE))
+               /* Fake groups can't be modified. We allow to drag to the favorite fake
+                * group tough so user can mark contact as favorite using DnD */
                return FALSE;
 
        /* Get source group information. */