]> git.0d.be Git - empathy.git/commitdiff
Contact should leave 'Ungrouped' group immediately upon first joining a group
authorChandni Verma <chandniverma2112@gmail.com>
Fri, 12 Jul 2013 15:16:31 +0000 (20:46 +0530)
committerChandni Verma <chandniverma2112@gmail.com>
Tue, 13 Aug 2013 15:25:05 +0000 (20:55 +0530)
https://bugzilla.gnome.org/show_bug.cgi?id=698530

libempathy-gtk/empathy-roster-view.c

index 7d168d4716d5c79cb639986a919addf90111af44..a6b6ffe5caaa6e8b446d186088e3800a01eef5b9 100644 (file)
@@ -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