[folks] Notify of Tpf.PersonaStore's Personas being removed when disabling accounts



commit 107927b9efc7760f69d368525c969d3ee33ecb3e
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Sep 9 12:33:22 2010 +0100

    Notify of Tpf.PersonaStore's Personas being removed when disabling accounts
    
    When disabling, removing or marking an account as invalid, we need to signal
    that the account's contacts (i.e. the Tpf.PersonaStore's Personas) have been
    removed. Closes: bgo#629082

 backends/telepathy/lib/tpf-persona-store.vala |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 5039dbd..1d30cc2 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -145,17 +145,29 @@ public class Tpf.PersonaStore : Folks.PersonaStore
       this.account_manager.account_disabled.connect ((a) =>
         {
           if (this.account == a)
-            this.removed ();
+            {
+              this.personas_changed (null, this._personas.get_values (), null,
+                  null, 0);
+              this.removed ();
+            }
         });
       this.account_manager.account_removed.connect ((a) =>
         {
           if (this.account == a)
-            this.removed ();
+            {
+              this.personas_changed (null, this._personas.get_values (), null,
+                  null, 0);
+              this.removed ();
+            }
         });
       this.account_manager.account_validity_changed.connect ((a, valid) =>
         {
           if (!valid && this.account == a)
-            this.removed ();
+            {
+              this.personas_changed (null, this._personas.get_values (), null,
+                  null, 0);
+              this.removed ();
+            }
         });
 
       this.account.status_changed.connect (this.account_status_changed_cb);
@@ -324,6 +336,9 @@ public class Tpf.PersonaStore : Folks.PersonaStore
 
       if (new_status == TelepathyGLib.ConnectionStatus.DISCONNECTED)
         {
+          /* When disconnecting, we want the PersonaStore to remain alive, but
+           * all its Personas to be removed. We do *not* want the PersonaStore
+           * to be destroyed, as that makes coming back online hard. */
           this.personas_changed (null, this._personas.get_values (), null, null,
               0);
           this.reset ();



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