summaryrefslogtreecommitdiff
path: root/src/connection-contact-info.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-08-15 16:50:09 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-08-16 12:07:41 +0100
commit4c46b78a768409dc56561d1556ff9cab13a2b572 (patch)
treef5f93c4715a306f3f1d7c843aad0e30f852924af /src/connection-contact-info.c
parent1fe8255709572fe97a338d848d419965a7dc1338 (diff)
downloadtelepathy-salut-4c46b78a768409dc56561d1556ff9cab13a2b572.tar.gz
ContactInfo: expose email and JID
I don't like the duplication in this function very much, but I don't think splitting it up into another function would make it much/any easier to read.
Diffstat (limited to 'src/connection-contact-info.c')
-rw-r--r--src/connection-contact-info.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/connection-contact-info.c b/src/connection-contact-info.c
index a4e722a5..3bb4f056 100644
--- a/src/connection-contact-info.c
+++ b/src/connection-contact-info.c
@@ -31,10 +31,11 @@ enum {
PROP_SUPPORTED_FIELDS
};
+static gchar *i_heart_the_internet[] = { "type=internet", NULL };
+
static GPtrArray *
get_supported_fields (void)
{
- static gchar *i_heart_the_internet[] = { "type=internet", NULL };
static TpContactInfoFieldSpec supported_fields[] = {
/* We're gonna omit 'fn' because it shows up as the alias. */
{ "n", NULL,
@@ -138,6 +139,30 @@ build_contact_info (
G_TYPE_INVALID));
}
+ if (email != NULL)
+ {
+ const gchar *field_value[] = { email, NULL };
+
+ g_ptr_array_add (contact_info,
+ tp_value_array_build (3,
+ G_TYPE_STRING, "email",
+ G_TYPE_STRV, i_heart_the_internet,
+ G_TYPE_STRV, field_value,
+ G_TYPE_INVALID));
+ }
+
+ if (jid != NULL)
+ {
+ const gchar *field_value[] = { jid, NULL };
+
+ g_ptr_array_add (contact_info,
+ tp_value_array_build (3,
+ G_TYPE_STRING, "x-jabber",
+ G_TYPE_STRV, NULL,
+ G_TYPE_STRV, field_value,
+ G_TYPE_INVALID));
+ }
+
return contact_info;
}