aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-contact-list-store.c8
-rw-r--r--libempathy-gtk/empathy-contact-list-store.h3
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c9
3 files changed, 16 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 3ebeacb4a..9feb4461f 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -728,11 +728,13 @@ empathy_contact_list_store_row_separator_func (GtkTreeModel *model,
gchar *
empathy_contact_list_store_get_parent_group (GtkTreeModel *model,
GtkTreePath *path,
- gboolean *path_is_group)
+ gboolean *path_is_group,
+ gboolean *is_fake_group)
{
GtkTreeIter parent_iter, iter;
gchar *name = NULL;
gboolean is_group;
+ gboolean fake;
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
@@ -762,6 +764,7 @@ empathy_contact_list_store_get_parent_group (GtkTreeModel *model,
gtk_tree_model_get (model, &iter,
EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
EMPATHY_CONTACT_LIST_STORE_COL_NAME, &name,
+ EMPATHY_CONTACT_LIST_STORE_COL_IS_FAKE_GROUP, &fake,
-1);
if (!is_group) {
g_free (name);
@@ -773,6 +776,9 @@ empathy_contact_list_store_get_parent_group (GtkTreeModel *model,
*path_is_group = TRUE;
}
+ if (is_fake_group != NULL)
+ *is_fake_group = fake;
+
return name;
}
diff --git a/libempathy-gtk/empathy-contact-list-store.h b/libempathy-gtk/empathy-contact-list-store.h
index db8f40cd7..1b36ea651 100644
--- a/libempathy-gtk/empathy-contact-list-store.h
+++ b/libempathy-gtk/empathy-contact-list-store.h
@@ -105,7 +105,8 @@ gboolean empathy_contact_list_store_row_separator_func (GtkTre
gpointer data);
gchar * empathy_contact_list_store_get_parent_group (GtkTreeModel *model,
GtkTreePath *path,
- gboolean *path_is_group);
+ gboolean *path_is_group,
+ gboolean *is_fake_group);
gboolean empathy_contact_list_store_search_equal_func (GtkTreeModel *model,
gint column,
const gchar *key,
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 2a3fb773e..e5638954f 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -266,19 +266,24 @@ contact_list_view_contact_drag_received (GtkWidget *view,
gchar *new_group = NULL;
gchar *old_group = NULL;
gboolean success = TRUE;
+ gboolean is_fake_group;
priv = GET_PRIV (view);
sel_data = (const gchar *) gtk_selection_data_get_data (selection);
new_group = empathy_contact_list_store_get_parent_group (model,
- path, NULL);
+ path, NULL, &is_fake_group);
+
+ if (is_fake_group)
+ /* Fake groups can't be modified */
+ return FALSE;
/* Get source group information. */
if (priv->drag_row) {
source_path = gtk_tree_row_reference_get_path (priv->drag_row);
if (source_path) {
old_group = empathy_contact_list_store_get_parent_group (
- model, source_path, NULL);
+ model, source_path, NULL, NULL);
gtk_tree_path_free (source_path);
}
}