[empathy] Contact should leave 'Ungrouped' group immediately upon first joining a group



commit 083966864e828b6c226285ac833a2179df9bb6f9
Author: Chandni Verma <chandniverma2112 gmail com>
Date:   Fri Jul 12 20:46:31 2013 +0530

    Contact should leave 'Ungrouped' group immediately upon first joining a group
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698530

 libempathy-gtk/empathy-roster-view.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 7d168d4..a6b6ffe 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]