[empathy] Don't try to block personas that don't support blocking



commit e68f14484d688716bb3d09fbc9ee4fa5ad17db9e
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Tue Mar 22 15:25:26 2011 +0000

    Don't try to block personas that don't support blocking

 libempathy/empathy-individual-manager.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index bbd5115..088c67f 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -545,6 +545,7 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
       TpfPersona *persona = l->data;
       EmpathyContact *contact;
       EmpathyContactManager *manager;
+      EmpathyContactListFlags flags;
 
       if (!TPF_IS_PERSONA (persona))
         continue;
@@ -553,9 +554,13 @@ empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
           tpf_persona_get_contact (persona));
       empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
       manager = empathy_contact_manager_dup_singleton ();
-      empathy_contact_list_set_blocked (
-          EMPATHY_CONTACT_LIST (manager),
-          contact, blocked, abusive);
+      flags = empathy_contact_manager_get_flags_for_connection (manager,
+          empathy_contact_get_connection (contact));
+
+      if (flags & EMPATHY_CONTACT_LIST_CAN_BLOCK)
+        empathy_contact_list_set_blocked (
+            EMPATHY_CONTACT_LIST (manager),
+            contact, blocked, abusive);
 
       g_object_unref (manager);
       g_object_unref (contact);



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