From: Philip Withnall Date: Mon, 2 Aug 2010 12:12:21 +0000 (+0100) Subject: Handle connections which are ready as soon as they're connected X-Git-Tag: FOLKS_0_1_12~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bae4f448fd91ac4fcf3a26ab3687da2b62080ade;p=platform%2Fupstream%2Ffolks.git Handle connections which are ready as soon as they're connected This fixes contacts from Facebook and MSN accounts sometimes not showing up in the contact list. Closes: bgo#625815 --- diff --git a/backends/telepathy/tpf-persona-store.vala b/backends/telepathy/tpf-persona-store.vala index c2174d9..650867a 100644 --- a/backends/telepathy/tpf-persona-store.vala +++ b/backends/telepathy/tpf-persona-store.vala @@ -319,24 +319,33 @@ public class Tpf.PersonaStore : Folks.PersonaStore return; var conn = this.account.get_connection (); - conn.notify["connection-ready"].connect ((s, p) => - { - var c = (Connection) s; + conn.notify["connection-ready"].connect (this.connection_ready_cb); - this.ll.connection_connect_to_new_group_channels (c, - this.new_group_channels_cb); + /* Deal with the case where the connection is already ready + * FIXME: We have to access the property manually until bgo#571348 is + * fixed. */ + bool connection_ready = false; + conn.get ("connection-ready", out connection_ready); - this.add_standard_channel (c, "publish"); - this.add_standard_channel (c, "stored"); - this.add_standard_channel (c, "subscribe"); - this.conn = c; + if (connection_ready == true) + this.connection_ready_cb (conn, null); + else + conn.prepare_async.begin (null); + } - /* We can only initialise the favourite contacts once conn is prepared - */ - this.initialise_favourite_contacts.begin (); - }); + private void connection_ready_cb (Object s, ParamSpec? p) + { + Connection c = (Connection) s; + this.ll.connection_connect_to_new_group_channels (c, + this.new_group_channels_cb); + + this.add_standard_channel (c, "publish"); + this.add_standard_channel (c, "stored"); + this.add_standard_channel (c, "subscribe"); + this.conn = c; - conn.prepare_async.begin (null); + /* We can only initialise the favourite contacts once conn is prepared */ + this.initialise_favourite_contacts.begin (); } private void new_group_channels_cb (void *data)