aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandni Verma <chandniverma2112@gmail.com>2013-07-12 23:16:31 +0800
committerChandni Verma <chandniverma2112@gmail.com>2013-08-13 23:25:05 +0800
commit083966864e828b6c226285ac833a2179df9bb6f9 (patch)
treec43a93aa3295bb8b784e717b32c9c668f620c4ef
parentb595f2d54c32e2ce5fdda1b4adf46b22115eced8 (diff)
downloadgsoc2013-empathy-083966864e828b6c226285ac833a2179df9bb6f9.tar
gsoc2013-empathy-083966864e828b6c226285ac833a2179df9bb6f9.tar.gz
gsoc2013-empathy-083966864e828b6c226285ac833a2179df9bb6f9.tar.bz2
gsoc2013-empathy-083966864e828b6c226285ac833a2179df9bb6f9.tar.lz
gsoc2013-empathy-083966864e828b6c226285ac833a2179df9bb6f9.tar.xz
gsoc2013-empathy-083966864e828b6c226285ac833a2179df9bb6f9.tar.zst
gsoc2013-empathy-083966864e828b6c226285ac833a2179df9bb6f9.zip
Contact should leave 'Ungrouped' group immediately upon first joining a group
https://bugzilla.gnome.org/show_bug.cgi?id=698530
-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