summaryrefslogtreecommitdiff
path: root/obexd/plugins/vcard.c
diff options
context:
space:
mode:
authorRadoslaw Jablonski <ext-jablonski.radoslaw@nokia.com>2010-08-19 09:49:47 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-12-04 22:48:25 +0100
commit2eb218abb77a1bc14285ef299b132a559a0988fe (patch)
tree3e7c562eac49014013dec750cac5459c7ae6d97e /obexd/plugins/vcard.c
parent22edcd6531b04bb9a815d01092f3a83e0549de9b (diff)
downloadbluez-2eb218abb77a1bc14285ef299b132a559a0988fe.tar.gz
obexd: Fix problem with multiple emails in vcard
Previously only one email appeared in generated vcard, even if contact had defined multiple email addresses in contact data. Changed vcard struct and phonebook-tracker pull_contacts func to support multiple emails.
Diffstat (limited to 'obexd/plugins/vcard.c')
-rw-r--r--obexd/plugins/vcard.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/obexd/plugins/vcard.c b/obexd/plugins/vcard.c
index af00cb5d0..18b595286 100644
--- a/obexd/plugins/vcard.c
+++ b/obexd/plugins/vcard.c
@@ -344,8 +344,12 @@ void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact,
}
}
- if (filter & FILTER_EMAIL)
- vcard_printf_email(vcards, contact->email);
+ if (filter & FILTER_EMAIL) {
+ GSList *l;
+
+ for (l = contact->emails; l; l = l->next)
+ vcard_printf_email(vcards, l->data);
+ }
if (filter & FILTER_ADR)
vcard_printf_adr(vcards, contact);
@@ -372,11 +376,13 @@ void phonebook_contact_free(struct phonebook_contact *contact)
g_slist_foreach(contact->numbers, number_free, NULL);
g_slist_free(contact->numbers);
+ g_slist_foreach(contact->emails, (GFunc) g_free, NULL);
+ g_slist_free(contact->emails);
+
g_free(contact->fullname);
g_free(contact->given);
g_free(contact->family);
g_free(contact->additional);
- g_free(contact->email);
g_free(contact->prefix);
g_free(contact->suffix);
g_free(contact->pobox);