[empathy/gnome-2-34] Really remove user from the blocked list when readding them



commit 1d431d242ed66a5ef3640fc927ffdeaaac14a882
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Wed Mar 23 15:46:46 2011 +1100

    Really remove user from the blocked list when readding them
    
    Previous commit in 161c9a2381a9c2df45ef8df81e8b680ce41b5c64 would have worked,
    if not for Folks. And it turns out the CM I tested against already happens to
    forget the blocked status if you readd a contact, so it looked like it was
    working.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=645487

 libempathy/empathy-individual-manager.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 8341b69..fd0125f 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -389,6 +389,7 @@ empathy_individual_manager_add_from_contact (EmpathyIndividualManager *self,
     EmpathyContact *contact)
 {
   EmpathyIndividualManagerPriv *priv;
+  EmpathyContactManager *contact_manager;
   FolksBackendStore *backend_store;
   FolksBackend *backend;
   FolksPersonaStore *persona_store;
@@ -443,6 +444,19 @@ empathy_individual_manager_add_from_contact (EmpathyIndividualManager *self,
 
   g_hash_table_destroy (details);
 
+  /* unblock the EmpathyContact */
+  contact_manager = empathy_contact_manager_dup_singleton ();
+
+  if (empathy_contact_manager_get_flags_for_connection (contact_manager,
+        empathy_contact_get_connection (contact)) &
+      EMPATHY_CONTACT_LIST_CAN_BLOCK)
+    {
+      empathy_contact_list_set_blocked (EMPATHY_CONTACT_LIST (contact_manager),
+          contact, FALSE, FALSE);
+    }
+
+  g_object_unref (contact_manager);
+
 finish:
   tp_clear_object (&backend);
   tp_clear_object (&backend_store);



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