diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c
index f28b234..ee8c42d 100644
--- a/obexd/plugins/phonebook-tracker.c
+++ b/obexd/plugins/phonebook-tracker.c
"nco:nameFamily(?c) nco:nameGiven(?c) " \
"nco:nameAdditional(?c) nco:nameHonorificPrefix(?c) " \
"nco:nameHonorificSuffix(?c) nco:emailAddress(?e) " \
- "nco:phoneNumber(?w) " \
+ "nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
+ "nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
+ "nco:postalcode(?p) nco:country(?p) " \
"WHERE { " \
"?c a nco:PersonContact ; " \
"nco:hasPhoneNumber ?h . " \
"OPTIONAL { " \
"?c nco:hasAffiliation ?a . " \
"?a nco:hasPhoneNumber ?w . " \
- "?c nco:hasEmailAddress ?e" \
+ "?c nco:hasEmailAddress ?e . " \
+ "?c nco:hasPostalAddress ?p . " \
"} " \
"}"
"nco:nameFamily(?c) nco:nameGiven(?c) " \
"nco:nameAdditional(?c) nco:nameHonorificPrefix(?c) " \
"nco:nameHonorificSuffix(?c) nco:emailAddress(?e) " \
- "nco:phoneNumber(?w) " \
+ "nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
+ "nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
+ "nco:postalcode(?p) nco:country(?p) " \
"WHERE { " \
"?call a nmo:Call ; " \
"nmo:from ?c ; " \
"OPTIONAL { " \
"?c nco:hasAffiliation ?a . " \
"?a nco:hasPhoneNumber ?w . " \
- "?c nco:hasEmailAddress ?e" \
+ "?c nco:hasEmailAddress ?e . " \
+ "?c nco:hasPostalAddress ?p . " \
"} " \
"} ORDER BY DESC(nmo:receivedDate(?call))"
"nco:nameFamily(?c) nco:nameGiven(?c) " \
"nco:nameAdditional(?c) nco:nameHonorificPrefix(?c) " \
"nco:nameHonorificSuffix(?c) nco:emailAddress(?e) " \
- "nco:phoneNumber(?w) " \
+ "nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
+ "nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
+ "nco:postalcode(?p) nco:country(?p) " \
"WHERE { " \
"?call a nmo:Call ; " \
"nmo:from ?c ; " \
"OPTIONAL { " \
"?c nco:hasAffiliation ?a . " \
"?a nco:hasPhoneNumber ?w . " \
- "?c nco:hasEmailAddress ?e" \
+ "?c nco:hasEmailAddress ?e . " \
+ "?c nco:hasPostalAddress ?p . " \
"} " \
"} ORDER BY DESC(nmo:receivedDate(?call))"
"nco:nameFamily(?c) nco:nameGiven(?c) " \
"nco:nameAdditional(?c) nco:nameHonorificPrefix(?c) " \
"nco:nameHonorificSuffix(?c) nco:emailAddress(?e) " \
- "nco:phoneNumber(?w) " \
+ "nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
+ "nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
+ "nco:postalcode(?p) nco:country(?p) " \
"WHERE { " \
"?call a nmo:Call ; " \
"nmo:to ?c ; " \
"OPTIONAL { " \
"?c nco:hasAffiliation ?a . " \
"?a nco:hasPhoneNumber ?w . " \
- "?c nco:hasEmailAddress ?e" \
+ "?c nco:hasEmailAddress ?e . " \
+ "?c nco:hasPostalAddress ?p . " \
"} " \
"} ORDER BY DESC(nmo:sentDate(?call))"
"nco:nameFamily(?c) nco:nameGiven(?c) " \
"nco:nameAdditional(?c) nco:nameHonorificPrefix(?c) " \
"nco:nameHonorificSuffix(?c) nco:emailAddress(?e) " \
- "nco:phoneNumber(?w) " \
+ "nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
+ "nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
+ "nco:postalcode(?p) nco:country(?p) " \
"WHERE { " \
"{ " \
"?call a nmo:Call ; " \
"OPTIONAL { " \
"?c nco:hasAffiliation ?a . " \
"?a nco:hasPhoneNumber ?w . " \
- "?c nco:hasEmailAddress ?e" \
+ "?c nco:hasEmailAddress ?e . " \
+ "?c nco:hasPostalAddress ?p . " \
"} " \
"} UNION { " \
"?call a nmo:Call ; " \
"OPTIONAL { " \
"?c nco:hasAffiliation ?a . " \
"?a nco:hasPhoneNumber ?w . " \
- "?c nco:hasEmailAddress ?e" \
+ "?c nco:hasEmailAddress ?e . " \
+ "?c nco:hasPostalAddress ?p . " \
"} " \
"} } "
"nco:nameFamily(?c) nco:nameGiven(?c) nco:nameAdditional(?c) " \
"nco:nameHonorificPrefix(?c) nco:nameHonorificSuffix(?c) " \
"nco:emailAddress(?e) " \
- "nco:phoneNumber(?w) " \
+ "nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
+ "nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
+ "nco:postalcode(?p) nco:country(?p) " \
"WHERE { " \
"?c a nco:PersonContact ; " \
"nco:contactUID <%s> ; " \
"OPTIONAL { " \
"?c nco:hasAffiliation ?a . " \
"?a nco:hasPhoneNumber ?w . " \
- "?c nco:hasEmailAddress ?e" \
+ "?c nco:hasEmailAddress ?e . " \
+ "?c nco:hasPostalAddress ?p . " \
"} " \
"}"
contact->prefix = g_strdup(reply[5]);
contact->suffix = g_strdup(reply[6]);
contact->email = g_strdup(reply[7]);
+ contact->pobox = g_strdup(reply[9]);
+ contact->extended = g_strdup(reply[10]);
+ contact->street = g_strdup(reply[11]);
+ contact->locality = g_strdup(reply[12]);
+ contact->region = g_strdup(reply[13]);
+ contact->postal = g_strdup(reply[14]);
+ contact->country = g_strdup(reply[15]);
number = g_new0(struct phonebook_number, 1);
number->tel = g_strdup(reply[0]);
data->user_data = user_data;
data->cb = cb;
- return query_tracker(query, 9, pull_contacts, data);
+ return query_tracker(query, 16, pull_contacts, data);
}
int phonebook_get_entry(const char *folder, const char *id,
query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id);
- ret = query_tracker(query, 9, pull_contacts, data);
+ ret = query_tracker(query, 16, pull_contacts, data);
g_free(query);
diff --git a/obexd/plugins/vcard.c b/obexd/plugins/vcard.c
index 0bd2052..6c2445c 100644
--- a/obexd/plugins/vcard.c
+++ b/obexd/plugins/vcard.c
}
}
+static void vcard_printf_adr(GString *vcards, struct phonebook_contact *contact)
+{
+ vcard_printf(vcards, "ADR:%s;%s;%s;%s;%s;%s;%s", contact->pobox,
+ contact->extended, contact->street,
+ contact->locality, contact->region,
+ contact->postal, contact->country);
+}
+
static void vcard_printf_end(GString *vcards)
{
vcard_printf(vcards, "END:VCARD");
if (filter & FILTER_EMAIL)
vcard_printf_email(vcards, contact->email);
+ if (filter & FILTER_ADR)
+ vcard_printf_adr(vcards, contact);
+
vcard_printf_end(vcards);
}
g_free(contact->email);
g_free(contact->prefix);
g_free(contact->suffix);
+ g_free(contact->pobox);
+ g_free(contact->extended);
+ g_free(contact->street);
+ g_free(contact->locality);
+ g_free(contact->region);
+ g_free(contact->postal);
+ g_free(contact->country);
g_free(contact);
}
diff --git a/obexd/plugins/vcard.h b/obexd/plugins/vcard.h
index 45b82d7..f2b5c09 100644
--- a/obexd/plugins/vcard.h
+++ b/obexd/plugins/vcard.h
char *email;
char *prefix;
char *suffix;
+ char *pobox;
+ char *extended;
+ char *street;
+ char *locality;
+ char *region;
+ char *postal;
+ char *country;
};
void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact,