[telepathy-glib-0.18] telepathy-glib: tp_connection_upgrade_contacts(): Use special trick of ready_enough_for_contacts

Xavier Claessens xclaesse at kemper.freedesktop.org
Tue Jul 24 07:15:13 PDT 2012


Module: telepathy-glib
Branch: telepathy-glib-0.18
Commit: e2f99aa39425dd3431e9cd8d09fb3b144c1ab0a7
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=e2f99aa39425dd3431e9cd8d09fb3b144c1ab0a7

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Tue Jul 24 15:28:00 2012 +0200

tp_connection_upgrade_contacts(): Use special trick of ready_enough_for_contacts

TpConnection itself wants to prepare TpContacts before being officially
CONNECTED. This was already the case for self contact. Use the same
trick for blocked contacts.

https://bugs.freedesktop.org/show_bug.cgi?id=52441

---

 telepathy-glib/contact.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 1854945..77962f2 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -4148,7 +4148,7 @@ tp_connection_get_contacts_by_handle (TpConnection *self,
 
   /* As an implementation detail, this method actually starts working slightly
    * before we're officially ready. We use this to get the TpContact for the
-   * SelfHandle. */
+   * Connection. */
   g_return_if_fail (self->priv->ready_enough_for_contacts);
 
   g_return_if_fail (tp_proxy_get_invalidated (self) == NULL);
@@ -4267,8 +4267,10 @@ tp_connection_upgrade_contacts (TpConnection *self,
   ContactsContext *context;
   guint i;
 
-  g_return_if_fail (tp_proxy_is_prepared (self,
-        TP_CONNECTION_FEATURE_CONNECTED));
+  /* As an implementation detail, this method actually starts working slightly
+   * before we're officially ready. We use this to get the TpContact for the
+   * Connection. */
+  g_return_if_fail (self->priv->ready_enough_for_contacts);
   g_return_if_fail (n_contacts >= 1);
   g_return_if_fail (contacts != NULL);
   g_return_if_fail (n_features == 0 || features != NULL);



More information about the telepathy-commits mailing list