From f68071937c2340fd5560c29f4502db146a459b5a Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Mon, 16 May 2011 18:25:48 +0100 Subject: Don't reset the alias when using empathy_contact_from_tpl_contact contact_set_property() calls empathy_contact_set_alias(), which tries to set the alias on the FolksPersona, but we don't want to do that when creating an EmpathyContact from a TplEntity. So just set priv->alias instead of passing it to g_object_new() instead. --- libempathy/empathy-contact.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libempathy') diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 5acf2ba34..7c66a28f8 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -680,10 +680,20 @@ empathy_contact_from_tpl_contact (TpAccount *account, if (existing_contact != NULL) { + EmpathyContactPriv *priv; + retval = g_object_new (EMPATHY_TYPE_CONTACT, "tp-contact", empathy_contact_get_tp_contact (existing_contact), - "alias", tpl_entity_get_alias (tpl_entity), NULL); + + priv = GET_PRIV (retval); + + /* contact_set_property() calls empathy_contact_set_alias(), which + * tries to set the alias on the FolksPersona, but we don't want to + * do that when creating an EmpathyContact from a TplEntity. So just + * set priv->alias instead of passing it to g_object_new() instead. */ + g_free (priv->alias); + priv->alias = g_strdup (tpl_entity_get_alias (tpl_entity)); } else { -- cgit v1.2.3