aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-07-07 23:25:53 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-22 04:25:14 +0800
commitd64a31579c0cdaa7013f5165f5111d57feb9b92e (patch)
tree19b6072428c8302e69840ae04c98ed2635301b0f /libempathy
parentb6568db4f81cf4e78e96aa5fe23f020de5ff6557 (diff)
downloadgsoc2013-empathy-d64a31579c0cdaa7013f5165f5111d57feb9b92e.tar
gsoc2013-empathy-d64a31579c0cdaa7013f5165f5111d57feb9b92e.tar.gz
gsoc2013-empathy-d64a31579c0cdaa7013f5165f5111d57feb9b92e.tar.bz2
gsoc2013-empathy-d64a31579c0cdaa7013f5165f5111d57feb9b92e.tar.lz
gsoc2013-empathy-d64a31579c0cdaa7013f5165f5111d57feb9b92e.tar.xz
gsoc2013-empathy-d64a31579c0cdaa7013f5165f5111d57feb9b92e.tar.zst
gsoc2013-empathy-d64a31579c0cdaa7013f5165f5111d57feb9b92e.zip
Update FolksPersona:alias when updating EmpathyContact:alias
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 57a4449c3..20fe9862e 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -629,6 +629,16 @@ empathy_contact_set_alias (EmpathyContact *contact,
g_object_ref (contact);
+ /* Set the alias on the persona if possible */
+ persona = empathy_contact_get_persona (contact);
+ if (persona != NULL && FOLKS_IS_ALIAS (persona))
+ {
+ DEBUG ("Setting alias for contact %s to %s",
+ empathy_contact_get_id (contact), alias);
+
+ folks_alias_set_alias (FOLKS_ALIAS (persona), alias);
+ }
+
if (tp_strdiff (alias, priv->alias))
{
g_free (priv->alias);
@@ -768,6 +778,11 @@ empathy_contact_set_persona (EmpathyContact *contact,
priv->persona = g_object_ref (persona);
g_object_notify (G_OBJECT (contact), "persona");
+
+ /* Set the persona's alias, since ours could've been set using
+ * empathy_contact_set_alias() before we had a persona; this happens when
+ * adding a contact. */
+ empathy_contact_set_alias (contact, priv->alias);
}
TpConnection *