diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-17 01:25:48 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-06-09 19:34:57 +0800 |
commit | f68071937c2340fd5560c29f4502db146a459b5a (patch) | |
tree | 8cdefa7a707a95de331cebf95f04509b427e2630 /libempathy | |
parent | 4ee7e811f1686d7a24d951269f46dd8be682ff84 (diff) | |
download | gsoc2013-empathy-f68071937c2340fd5560c29f4502db146a459b5a.tar gsoc2013-empathy-f68071937c2340fd5560c29f4502db146a459b5a.tar.gz gsoc2013-empathy-f68071937c2340fd5560c29f4502db146a459b5a.tar.bz2 gsoc2013-empathy-f68071937c2340fd5560c29f4502db146a459b5a.tar.lz gsoc2013-empathy-f68071937c2340fd5560c29f4502db146a459b5a.tar.xz gsoc2013-empathy-f68071937c2340fd5560c29f4502db146a459b5a.tar.zst gsoc2013-empathy-f68071937c2340fd5560c29f4502db146a459b5a.zip |
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.
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-contact.c | 12 |
1 files changed, 11 insertions, 1 deletions
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 { |