[empathy/gnome-2-34] Don't try to block personas that don't support blocking



commit 8e416d8de3b381a7d869e463125fc938d43820bb
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Tue Mar 22 14:35:34 2011 +0000

    Don't try to block personas that don't support blocking
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645488

 libempathy/empathy-individual-manager.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 7ae1a90..8341b69 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -548,16 +548,23 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
     {
       TpfPersona *persona = l->data;
       EmpathyContact *contact;
+      EmpathyIndividualManagerFlags flags;
 
       if (!TPF_IS_PERSONA (persona))
         continue;
 
       contact = empathy_contact_dup_from_tp_contact (
           tpf_persona_get_contact (persona));
-      empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
-      empathy_contact_list_set_blocked (
-          EMPATHY_CONTACT_LIST (priv->contact_manager),
-          contact, blocked, abusive);
+      flags = empathy_individual_manager_get_flags_for_connection (self,
+          empathy_contact_get_connection (contact));
+
+      if (flags & EMPATHY_INDIVIDUAL_MANAGER_CAN_BLOCK)
+        {
+          empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
+          empathy_contact_list_set_blocked (
+              EMPATHY_CONTACT_LIST (priv->contact_manager),
+              contact, blocked, abusive);
+        }
 
       g_object_unref (contact);
     }



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