diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 10:42:39 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 12:07:41 +0100 |
commit | 7b616f381e4c1ef705b03195215b3b230b455b07 (patch) | |
tree | 0937a790d22fd9cace1475a887e2792e8692914e /src/contact.c | |
parent | 41bb4ec0a5fdd056e47568729a3e8bdd589c59e0 (diff) | |
download | telepathy-salut-7b616f381e4c1ef705b03195215b3b230b455b07.tar.gz |
Contact: track shoddily-computed full name
Diffstat (limited to 'src/contact.c')
-rw-r--r-- | src/contact.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/contact.c b/src/contact.c index 555952f1..42e40855 100644 --- a/src/contact.c +++ b/src/contact.c @@ -343,6 +343,7 @@ salut_contact_finalize (GObject *object) g_free (self->avatar_token); g_free (self->first); g_free (self->last); + g_free (self->full_name); g_free (self->email); g_free (self->jid); @@ -538,6 +539,18 @@ salut_contact_change_real_name ( self->first = g_strdup (first); g_free (self->last); self->last = g_strdup (last); + + g_free (self->full_name); + + if (!tp_str_empty (first) && !tp_str_empty (last)) + self->full_name = g_strdup_printf ("%s %s", first, last); + else if (!tp_str_empty (first)) + self->full_name = g_strdup (first); + else if (!tp_str_empty (last)) + self->full_name = g_strdup (last); + else + self->full_name = NULL; + salut_contact_change (self, SALUT_CONTACT_REAL_NAME_CHANGED); } } |