diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 10:42:56 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-16 12:07:41 +0100 |
commit | 55a1ee445c98ca0f1c9b1bc52b210eb983df077e (patch) | |
tree | 9d093cfc79df263c3b6ec3a7187e62b781ccd3cd /src/connection-contact-info.c | |
parent | 7b616f381e4c1ef705b03195215b3b230b455b07 (diff) | |
download | telepathy-salut-55a1ee445c98ca0f1c9b1bc52b210eb983df077e.tar.gz |
ContactInfo: expose fake FN field
Diffstat (limited to 'src/connection-contact-info.c')
-rw-r--r-- | src/connection-contact-info.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/connection-contact-info.c b/src/connection-contact-info.c index 2f1c804f..4311289b 100644 --- a/src/connection-contact-info.c +++ b/src/connection-contact-info.c @@ -37,9 +37,14 @@ static GPtrArray * get_supported_fields (void) { static TpContactInfoFieldSpec supported_fields[] = { - /* We're gonna omit 'fn' because it shows up as the alias. */ + /* We omit 'nickname' because it shows up, unmodifiably, as the alias. */ { "n", NULL, TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT, 1 }, + /* It's a little bit sketchy to expose 1st + ' ' + last as FN. But such + * are the limitations of the protocol. + */ + { "fn", NULL, + TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT, 1 }, { "email", i_heart_the_internet, TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT, 1 }, /* x-jabber is used for compatibility with Gabble */ @@ -131,6 +136,7 @@ static GPtrArray * build_contact_info ( const gchar *first, const gchar *last, + const gchar *full_name, const gchar *email, const gchar *jid) { @@ -154,6 +160,9 @@ build_contact_info ( G_TYPE_STRV, NULL, G_TYPE_STRV, field_value, G_TYPE_INVALID)); + + g_warn_if_fail (full_name != NULL); + add_singleton_field (contact_info, "fn", NULL, full_name); } if (email != NULL) @@ -171,8 +180,8 @@ build_contact_info_for_contact ( { g_return_val_if_fail (contact != NULL, NULL); - return build_contact_info (contact->first, contact->last, contact->email, - contact->jid); + return build_contact_info (contact->first, contact->last, contact->full_name, + contact->email, contact->jid); } static void |