aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-contact-factory.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-16 18:43:42 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-16 18:43:42 +0800
commit999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57 (patch)
treed7098daf7eb22c76bf205901e8d33178d4bab1ca /libempathy/empathy-tp-contact-factory.c
parentaced378e7a74252e006495a6f219034b93f4db0b (diff)
downloadgsoc2013-empathy-999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57.tar
gsoc2013-empathy-999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57.tar.gz
gsoc2013-empathy-999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57.tar.bz2
gsoc2013-empathy-999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57.tar.lz
gsoc2013-empathy-999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57.tar.xz
gsoc2013-empathy-999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57.tar.zst
gsoc2013-empathy-999773dc6f0e4eedf7d90ccf1fac8c7e0c7d5c57.zip
If the RequestAliases fails, make sure the name property on all contacts becomes ready to avoid waiting infinitely.
svn path=/trunk/; revision=952
Diffstat (limited to 'libempathy/empathy-tp-contact-factory.c')
-rw-r--r--libempathy/empathy-tp-contact-factory.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index 1c7c33f76..25ebceb5f 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -223,6 +223,22 @@ tp_contact_factory_request_aliases_cb (TpConnection *connection,
if (error) {
empathy_debug (DEBUG_DOMAIN, "Error requesting aliases: %s",
error->message);
+
+ /* If we failed to get alias set it to NULL, like that if
+ * someone is waiting for the name to be ready it won't wait
+ * infinitely */
+ while (*handles != 0) {
+ EmpathyContact *contact;
+
+ contact = tp_contact_factory_find_by_handle (
+ (EmpathyTpContactFactory*) tp_factory,
+ *handles);
+ if (contact) {
+ empathy_contact_set_name (contact, NULL);
+ }
+
+ handles++;
+ }
return;
}
@@ -601,7 +617,8 @@ tp_contact_factory_request_everything (EmpathyTpContactFactory *tp_factory,
/* FIXME: Sometimes the dbus call timesout because CM takes
* too much time to request all aliases from the server,
* that's why we increase the timeout here. See fd.o bug #14795 */
- dup_handles = g_memdup (handles->data, handles->len * sizeof (guint));
+ dup_handles = g_malloc0 ((handles->len + 1) * sizeof (guint));
+ g_memmove (dup_handles, handles->data, handles->len * sizeof (guint));
tp_cli_connection_interface_aliasing_call_request_aliases (priv->connection,
5*60*1000,
handles,