=?utf-8?q?=5Bfolks=5D_Bug_657738_=E2=80=94_Favorite_people_are_not_always?= =?utf-8?q?_displayed?=



commit 674ae6308505993944482d456683f9b03058b185
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Sep 17 22:16:07 2011 +0100

    Bug 657738 â Favorite people are not always displayed
    
    Ensure the TpLogger connection in Tpf.PersonaStore is always prepared before
    we first attempt to use favourite contact data.
    
    This should fix the situation where IM connections are already prepared before
    folks is prepared (i.e. _connection_ready_cb() is called as soon as the
    Tpf.PersonaStore is prepared).
    
    Closes: bgo#657738

 NEWS                                          |    1 +
 backends/telepathy/lib/tpf-persona-store.vala |   35 +++++++++++++-----------
 2 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/NEWS b/NEWS
index dcdc62e..385666f 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Bugs fixed:
   misleading
 * Bug 658161 â Consistently use âcontactâ in translatable strings instead of
   âpersonaâ
+* Bug 657738 â Favorite people are not always displayed
 
 API changes:
 * Individual.avatar is now settable using Individual.change_avatar() (not new
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 691dfc1..3ee7402 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -561,6 +561,25 @@ public class Tpf.PersonaStore : Folks.PersonaStore
                         }
                     });
 
+              /* We have to connect to the logger before dealing with the
+               * account status, because if the account's already connected we
+               * want to be able to query favourite information immediately. */
+              try
+                {
+                  this._logger = new Logger (this.id);
+                  yield this._logger.prepare ();
+                  this._logger.invalidated.connect (
+                      this._logger_invalidated_cb);
+                  this._logger.favourite_contacts_changed.connect (
+                      this._favourite_contacts_changed_cb);
+                }
+              catch (GLib.Error e)
+                {
+                  warning (
+                      _("Couldn't connect to the telepathy-logger service."));
+                  this._logger = null;
+                }
+
               this.account.status_changed.connect (
                   this._account_status_changed_cb);
 
@@ -586,22 +605,6 @@ public class Tpf.PersonaStore : Folks.PersonaStore
                   this._notify_if_is_quiescent ();
                 }
 
-              try
-                {
-                  this._logger = new Logger (this.id);
-                  yield this._logger.prepare ();
-                  this._logger.invalidated.connect (
-                      this._logger_invalidated_cb);
-                  this._logger.favourite_contacts_changed.connect (
-                      this._favourite_contacts_changed_cb);
-                }
-              catch (GLib.Error e)
-                {
-                  warning (
-                      _("Couldn't connect to the telepathy-logger service."));
-                  this._logger = null;
-                }
-
               this._is_prepared = true;
               this.notify_property ("is-prepared");
             }



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