From 674ae6308505993944482d456683f9b03058b185 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sat, 17 Sep 2011 22:16:07 +0100 Subject: [PATCH] =?utf8?q?Bug=20657738=20=E2=80=94=20Favorite=20people=20a?= =?utf8?q?re=20not=20always=20displayed?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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"); } -- 2.7.4