From 4c3ee0455ea066b5fd4cb07a54c0bc6e0012d848 Mon Sep 17 00:00:00 2001 From: Rafal Michalski <michalski.raf@xxxxxxxxx> Date: Wed, 1 Sep 2010 16:08:35 +0200 Subject: [PATCH] Add handling of UID contact's field in vCard After pulling contacts this field wasn't presented in downloaded vCard structure in spite of that it existed (not empty). Now it shows downloaded UID (using database query). --- plugins/phonebook-tracker.c | 1 + plugins/vcard.c | 4 ++++ plugins/vcard.h | 1 + 3 files changed, 6 insertions(+), 0 deletions(-) diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c index 193226f..bdd9587 100644 --- a/plugins/phonebook-tracker.c +++ b/plugins/phonebook-tracker.c @@ -866,6 +866,7 @@ add_entry: contact->company = g_strdup(reply[22]); contact->department = g_strdup(reply[23]); contact->title = g_strdup(reply[24]); + contact->uid = g_strdup(reply[CONTACTS_ID_COL]); set_call_type(contact, reply[COL_DATE], reply[COL_SENT], reply[COL_ANSWERED]); diff --git a/plugins/vcard.c b/plugins/vcard.c index 6d74e06..4a77eb3 100644 --- a/plugins/vcard.c +++ b/plugins/vcard.c @@ -468,6 +468,9 @@ void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact, vcard_printf_begin(vcards, format); + if (filter & FILTER_UID) + vcard_printf_tag(vcards, format, "UID", NULL, contact->uid); + if (filter & FILTER_N) vcard_printf_name(vcards, contact); @@ -580,6 +583,7 @@ void phonebook_contact_free(struct phonebook_contact *contact) g_slist_foreach(contact->addresses, address_free, NULL); g_slist_free(contact->addresses); + g_free(contact->uid); g_free(contact->fullname); g_free(contact->given); g_free(contact->family); diff --git a/plugins/vcard.h b/plugins/vcard.h index d012106..4d134c2 100644 --- a/plugins/vcard.h +++ b/plugins/vcard.h @@ -62,6 +62,7 @@ struct phonebook_address { }; struct phonebook_contact { + char *uid; char *fullname; char *given; char *family; -- 1.6.3.3