]> git.0d.be Git - empathy.git/commitdiff
Show a contact as blocked if *all* is personas are blocked
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 14 Dec 2011 12:04:15 +0000 (13:04 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 14 Dec 2011 12:24:05 +0000 (13:24 +0100)
It's clearer that way.

https://bugzilla.gnome.org/show_bug.cgi?id=665038

libempathy-gtk/empathy-individual-menu.c

index fa97877c0a20ccb51e6a13a48c1c67dedf32098c..0a2bf49a3fb19585c16a77bd8c82dc2695b563a0 100644 (file)
@@ -593,18 +593,21 @@ update_block_menu_item (GtkWidget *item,
     FolksIndividual *individual)
 {
   GList *contacts, *l;
-  gboolean is_blocked = FALSE;
+  gboolean is_blocked = TRUE;
 
   contacts = get_contacts_supporting_blocking (individual);
 
-  /* Check the menu item if there is at least one persona blocked */
+  if (contacts == NULL)
+    is_blocked = FALSE;
+
+  /* Check the menu item if all his personas are blocked */
   for (l = contacts; l != NULL; l = g_list_next (l))
     {
       TpContact *contact = l->data;
 
-      if (tp_contact_is_blocked (contact))
+      if (!tp_contact_is_blocked (contact))
         {
-          is_blocked = TRUE;
+          is_blocked = FALSE;
           break;
         }
     }