Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Add handling of UID contact's field in vCard
@ 2010-09-02  7:04 Rafał Michalski
  2010-09-02  8:10 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Rafał Michalski @ 2010-09-02  7:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-Add-handling-of-UID-contact-s-field-in-vCard.patch --]
[-- Type: text/x-patch, Size: 2012 bytes --]

From 4c3ee0455ea066b5fd4cb07a54c0bc6e0012d848 Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add handling of UID contact's field in vCard
  2010-09-02  7:04 [PATCH] Add handling of UID contact's field in vCard Rafał Michalski
@ 2010-09-02  8:10 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-09-02  8:10 UTC (permalink / raw)
  To: Rafał Michalski; +Cc: linux-bluetooth

Hi Rafal,

On Thu, Sep 02, 2010, Rafał Michalski wrote:
> From: Rafal Michalski <michalski.raf@gmail.com>
> 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(-)

Thanks. The patch has been pushed upstream.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-02  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-02  7:04 [PATCH] Add handling of UID contact's field in vCard Rafał Michalski
2010-09-02  8:10 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox