diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c
index 1109968..fd92125 100644
--- a/obexd/plugins/phonebook-tracker.c
+++ b/obexd/plugins/phonebook-tracker.c
#define TRACKER_RESOURCES_INTERFACE "org.freedesktop.Tracker1.Resources"
#define TRACKER_DEFAULT_CONTACT_ME "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me"
-#define CONTACTS_ID_COL 21
-#define PULL_QUERY_COL_AMOUNT 22
+#define CONTACTS_ID_COL 25
+#define PULL_QUERY_COL_AMOUNT 26
#define COL_HOME_NUMBER 0
#define COL_HOME_EMAIL 7
#define COL_WORK_NUMBER 8
#define COL_FAX_NUMBER 16
#define COL_WORK_EMAIL 17
-#define COL_DATE 18
-#define COL_SENT 19
-#define COL_ANSWERED 20
+#define COL_DATE 22
+#define COL_SENT 23
+#define COL_ANSWERED 24
#define CONTACTS_QUERY_ALL \
"SELECT ?v nco:fullname(?c) " \
"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) " \
+ "nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) " \
+ "nco:photo(?c) " \
"\"NOTACALL\" \"false\" \"false\" ?c " \
"WHERE { " \
"?c a nco:PersonContact . " \
"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) " \
+ "nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) " \
+ "nco:photo(?c) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) " \
+ "nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) " \
+ "nco:photo(?c) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew)" \
+ "nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) " \
+ "nco:photo(?c) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) " \
+ "nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) " \
+ "nco:photo(?c) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) " \
"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) " \
"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew)" \
+ "nco:birthDate(<%s>) nco:nickname(<%s>) nco:websiteUrl(<%s>) " \
+ "nco:photo(<%s>) " \
"\"NOTACALL\" \"false\" \"false\" <%s> " \
"WHERE { " \
"<%s> a nco:Contact . " \
contact->region = g_strdup(reply[13]);
contact->postal = g_strdup(reply[14]);
contact->country = g_strdup(reply[15]);
+ contact->birthday = g_strdup(reply[18]);
+ contact->nickname = g_strdup(reply[19]);
+ contact->website = g_strdup(reply[20]);
+ contact->photo = g_strdup(reply[21]);
set_call_type(contact, reply[COL_DATE], reply[COL_SENT],
reply[COL_ANSWERED]);
data->vcardentry = TRUE;
query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id, id, id, id, id,
- id, id, id, id, id, id, id);
+ id, id, id, id, id, id, id,
+ id, id, id, id);
ret = query_tracker(query, PULL_QUERY_COL_AMOUNT, pull_contacts, data);
diff --git a/obexd/plugins/vcard.c b/obexd/plugins/vcard.c
index 18b5952..05a8a13 100644
--- a/obexd/plugins/vcard.c
+++ b/obexd/plugins/vcard.c
vcard_printf(vcards, buf, number);
}
+static void vcard_printf_tag(GString *vcards, const char *tag,
+ const char *category, const char *fld)
+{
+ char *separator = "", *type = "";
+ char buf[LEN_MAX];
+
+ if (tag == NULL || strlen(tag) == 0)
+ return;
+
+ if (fld == NULL || strlen(fld) == 0)
+ return;
+
+ if (category && strlen(category)) {
+ separator = ";";
+ type = "TYPE=";
+ } else {
+ category = "";
+ }
+
+ snprintf(buf, LEN_MAX, "%s%s%s%s", tag, separator, type, category);
+
+ vcard_printf(vcards, "%s:%s", buf, fld);
+}
+
+static void vcard_printf_slash_tag(GString *vcards, const char *tag,
+ const char *category, const char *fld)
+{
+ int len;
+ char *separator = "", *type = "";
+ char buf[LEN_MAX], field[LEN_MAX];
+
+ if (tag == NULL || strlen(tag) == 0)
+ return;
+
+ if (fld == NULL || (len = strlen(fld)) == 0)
+ return;
+
+ if (category && strlen(category)) {
+ separator = ";";
+ type = "TYPE=";
+ } else {
+ category = "";
+ }
+
+ snprintf(buf, LEN_MAX, "%s%s%s%s", tag, separator, type, category);
+
+ add_slash(field, fld, LEN_MAX, len);
+ vcard_printf(vcards, "%s:%s", buf, field);
+}
+
static void vcard_printf_email(GString *vcards, const char *email)
{
int len = 0;
if (filter & FILTER_ADR)
vcard_printf_adr(vcards, contact);
+ if (filter & FILTER_BDAY)
+ vcard_printf_tag(vcards, "BDAY", NULL, contact->birthday);
+
+ if (filter & FILTER_NICKNAME)
+ vcard_printf_slash_tag(vcards, "NICKNAME", NULL,
+ contact->nickname);
+
+ if (filter & FILTER_URL)
+ vcard_printf_slash_tag(vcards, "URL", "INTERNET",
+ contact->website);
+
+ if (filter & FILTER_PHOTO)
+ vcard_printf_tag(vcards, "PHOTO", NULL, contact->photo);
+
if (filter & FILTER_X_IRMC_CALL_DATETIME)
vcard_printf_datetime(vcards, contact);
g_free(contact->region);
g_free(contact->postal);
g_free(contact->country);
+ g_free(contact->birthday);
+ g_free(contact->nickname);
+ g_free(contact->website);
+ g_free(contact->photo);
g_free(contact->datetime);
g_free(contact);
}
diff --git a/obexd/plugins/vcard.h b/obexd/plugins/vcard.h
index fa571e4..a9809ea 100644
--- a/obexd/plugins/vcard.h
+++ b/obexd/plugins/vcard.h
char *region;
char *postal;
char *country;
+ char *birthday;
+ char *nickname;
+ char *website;
+ char *photo;
char *datetime;
int calltype;
};