* [PATCH] Fix pull phonebook reply if filter not set
@ 2010-11-10 11:43 Lukasz Pawlik
2010-11-11 9:29 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Pawlik @ 2010-11-10 11:43 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Lukasz Pawlik
According to the PBAP specification if filter is not set or is set to
0x00000000 in the application parameters header all attributes of the vCard
should be returned. Previously only mandatory attributes were returned in
phonebook pull reply. This patch fix this and now all currently supported
vCards attributes will be returned.
---
plugins/vcard.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/plugins/vcard.c b/plugins/vcard.c
index 41f9fbd..3f69189 100644
--- a/plugins/vcard.c
+++ b/plugins/vcard.c
@@ -457,10 +457,16 @@ static void vcard_printf_end(GString *vcards)
void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact,
uint64_t filter, uint8_t format)
{
- if (format == FORMAT_VCARD30)
+ if (format == FORMAT_VCARD30 && filter)
filter |= (FILTER_VERSION | FILTER_FN | FILTER_N | FILTER_TEL);
- else if (format == FORMAT_VCARD21)
+ else if (format == FORMAT_VCARD21 && filter)
filter |= (FILTER_VERSION | FILTER_N | FILTER_TEL);
+ else
+ filter = (FILTER_VERSION | FILTER_UID | FILTER_N | FILTER_FN |
+ FILTER_TEL | FILTER_EMAIL | FILTER_ADR |
+ FILTER_BDAY | FILTER_NICKNAME | FILTER_URL |
+ FILTER_PHOTO | FILTER_ORG | FILTER_ROLE |
+ FILTER_TITLE | FILTER_X_IRMC_CALL_DATETIME);
vcard_printf_begin(vcards, format);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Fix pull phonebook reply if filter not set
2010-11-10 11:43 [PATCH] Fix pull phonebook reply if filter not set Lukasz Pawlik
@ 2010-11-11 9:29 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-11-11 9:29 UTC (permalink / raw)
To: Lukasz Pawlik; +Cc: linux-bluetooth
Hi Lukasz,
On Wed, Nov 10, 2010, Lukasz Pawlik wrote:
> According to the PBAP specification if filter is not set or is set to
> 0x00000000 in the application parameters header all attributes of the vCard
> should be returned. Previously only mandatory attributes were returned in
> phonebook pull reply. This patch fix this and now all currently supported
> vCards attributes will be returned.
> ---
> plugins/vcard.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-11 9:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-10 11:43 [PATCH] Fix pull phonebook reply if filter not set Lukasz Pawlik
2010-11-11 9:29 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox