aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-16 20:48:24 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-16 20:48:24 +0800
commit302b631948b98ba90a43d59437751a6e9906779f (patch)
tree092259bde8af199dacd51f9301208ac57d4fdc05
parent70b7f83a93603909fd478a3b6c7d16c81aee3703 (diff)
downloadgsoc2013-empathy-302b631948b98ba90a43d59437751a6e9906779f.tar
gsoc2013-empathy-302b631948b98ba90a43d59437751a6e9906779f.tar.gz
gsoc2013-empathy-302b631948b98ba90a43d59437751a6e9906779f.tar.bz2
gsoc2013-empathy-302b631948b98ba90a43d59437751a6e9906779f.tar.lz
gsoc2013-empathy-302b631948b98ba90a43d59437751a6e9906779f.tar.xz
gsoc2013-empathy-302b631948b98ba90a43d59437751a6e9906779f.tar.zst
gsoc2013-empathy-302b631948b98ba90a43d59437751a6e9906779f.zip
Retry requesting aliases if it fails, it can happen if there is too many aliases to request and it takes too much time
svn path=/trunk/; revision=798
-rw-r--r--libempathy/empathy-contact.c2
-rw-r--r--libempathy/empathy-tp-contact-factory.c28
2 files changed, 26 insertions, 4 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 893fabb5a..ec91f3a00 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -423,7 +423,7 @@ empathy_contact_set_name (EmpathyContact *contact,
g_free (priv->name);
priv->name = g_strdup (name);
contact_set_ready_flag (contact, EMPATHY_CONTACT_READY_NAME,
- !G_STR_EMPTY (name));
+ name != NULL);
g_object_notify (G_OBJECT (contact), "name");
}
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index 1ff0c403b..929f2b2f5 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -215,13 +215,35 @@ tp_contact_factory_request_aliases_cb (TpConnection *connection,
gpointer user_data,
GObject *tp_factory)
{
- guint *handles = user_data;
- guint i = 0;
- const gchar **name;
+ EmpathyTpContactFactoryPriv *priv = GET_PRIV (tp_factory);
+ guint *handles = user_data;
+ guint i = 0;
+ const gchar **name;
if (error) {
+ GArray handles_array;
+ guint size = 0;
+
empathy_debug (DEBUG_DOMAIN, "Error requesting aliases: %s",
error->message);
+
+ /* FIXME: Sometimes the dbus call timesout because CM takes
+ * too much time to request all aliases from the server,
+ * that's why we retry. */
+ while (handles[size] != 0) {
+ size++;
+ }
+ handles = g_memdup (handles, size * sizeof (guint));
+ handles_array.len = size;
+ handles_array.data = (gchar*) handles;
+
+ tp_cli_connection_interface_aliasing_call_request_aliases (priv->connection,
+ -1,
+ &handles_array,
+ tp_contact_factory_request_aliases_cb,
+ handles, g_free,
+ G_OBJECT (tp_factory));
+
return;
}