aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-roster-view.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 7d168d471..a6b6ffe5c 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -72,6 +72,11 @@ struct _EmpathyRosterViewPriv
EmpathyRosterModel *model;
};
+/* Prototypes to break cycles */
+static void remove_from_group (EmpathyRosterView *self,
+ FolksIndividual *individual,
+ const gchar *group);
+
typedef struct
{
guint id;
@@ -345,6 +350,14 @@ add_to_group (EmpathyRosterView *self,
update_group_widgets (self, roster_group,
EMPATHY_ROSTER_CONTACT (contact), TRUE);
}
+
+ if (tp_strdiff (group, NO_GROUP) &&
+ tp_strdiff (group, EMPATHY_ROSTER_MODEL_GROUP_UNGROUPED) &&
+ g_hash_table_size (contacts) == 2 /* 1:Ungrouped and 2:first group */)
+ {
+ remove_from_group (self, individual,
+ EMPATHY_ROSTER_MODEL_GROUP_UNGROUPED);
+ }
}
static void