Bug 657738 — Favorite people are not always displayed
authorPhilip Withnall <philip@tecnocode.co.uk>
Sat, 17 Sep 2011 21:16:07 +0000 (22:16 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Sun, 18 Sep 2011 13:03:26 +0000 (14:03 +0100)
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
backends/telepathy/lib/tpf-persona-store.vala

diff --git a/NEWS b/NEWS
index dcdc62e..385666f 100644 (file)
--- 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
index 691dfc1..3ee7402 100644 (file)
@@ -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");
             }