From 49fb62644e619712478ba4e4f07a3b6bbf489323 Mon Sep 17 00:00:00 2001 From: Rafal Michalski Date: Wed, 1 Sep 2010 16:08:35 +0200 Subject: [PATCH] obexd: 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). --- obexd/plugins/phonebook-tracker.c | 1 + obexd/plugins/vcard.c | 4 ++++ obexd/plugins/vcard.h | 1 + 3 files changed, 6 insertions(+) diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c index 193226fbd..bdd958724 100644 --- a/obexd/plugins/phonebook-tracker.c +++ b/obexd/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/obexd/plugins/vcard.c b/obexd/plugins/vcard.c index 6d74e06a6..4a77eb312 100644 --- a/obexd/plugins/vcard.c +++ b/obexd/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/obexd/plugins/vcard.h b/obexd/plugins/vcard.h index d012106ac..4d134c2d3 100644 --- a/obexd/plugins/vcard.h +++ b/obexd/plugins/vcard.h @@ -62,6 +62,7 @@ struct phonebook_address { }; struct phonebook_contact { + char *uid; char *fullname; char *given; char *family; -- 2.47.3