diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c
index fd92125..3f63dcb 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 25
-#define PULL_QUERY_COL_AMOUNT 26
+#define CONTACTS_ID_COL 28
+#define PULL_QUERY_COL_AMOUNT 29
#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 22
-#define COL_SENT 23
-#define COL_ANSWERED 24
+#define COL_DATE 25
+#define COL_SENT 26
+#define COL_ANSWERED 27
#define CONTACTS_QUERY_ALL \
"SELECT ?v nco:fullname(?c) " \
"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) " \
+ "nco:photo(?c) nco:fullname(?o) nco:department(?a) " \
+ "nco:role(?a) " \
"\"NOTACALL\" \"false\" \"false\" ?c " \
"WHERE { " \
"?c a nco:PersonContact . " \
"?c nco:hasAffiliation ?a . " \
"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " \
"OPTIONAL { ?a nco:hasEmailAddress ?ew . } " \
+ "OPTIONAL { ?a nco:org ?o . } " \
"} " \
"}"
"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) " \
+ "nco:photo(?c) nco:fullname(?o) nco:department(?a) " \
+ "nco:role(?a) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"?c nco:hasAffiliation ?a . " \
"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " \
"OPTIONAL { ?a nco:hasEmailAddress ?ew . } " \
+ "OPTIONAL { ?a nco:org ?o . } " \
"} " \
"} ORDER BY DESC(nmo:receivedDate(?call))"
"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) " \
+ "nco:photo(?c) nco:fullname(?o) nco:department(?a) " \
+ "nco:role(?a) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"?c nco:hasAffiliation ?a . " \
"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " \
"OPTIONAL { ?a nco:hasEmailAddress ?ew . } " \
+ "OPTIONAL { ?a nco:org ?o . } " \
"} " \
"} ORDER BY DESC(nmo:receivedDate(?call))"
"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) " \
+ "nco:photo(?c) nco:fullname(?o) nco:department(?a) " \
+ "nco:role(?a) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"?c nco:hasAffiliation ?a . " \
"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " \
"OPTIONAL { ?a nco:hasEmailAddress ?ew . } " \
+ "OPTIONAL { ?a nco:org ?o . } " \
"} " \
"} ORDER BY DESC(nmo:sentDate(?call))"
"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) " \
+ "nco:photo(?c) nco:fullname(?o) nco:department(?a) " \
+ "nco:role(?a) " \
"nmo:receivedDate(?call) " \
"nmo:isSent(?call) nmo:isAnswered(?call) ?c " \
"WHERE { " \
"OPTIONAL { ?c nco:hasAffiliation ?a . " \
"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " \
"OPTIONAL { ?a nco:hasEmailAddress ?ew . } " \
+ "OPTIONAL { ?a nco:org ?o . } " \
"} " \
"} UNION { " \
"?call a nmo:Call ; " \
"OPTIONAL { ?c nco:hasAffiliation ?a . " \
"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " \
"OPTIONAL { ?a nco:hasEmailAddress ?ew . } " \
+ "OPTIONAL { ?a nco:org ?o . } " \
"} " \
"} } ORDER BY DESC(nmo:receivedDate(?call))"
"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>) " \
+ "nco:photo(<%s>) nco:fullname(?o) nco:department(?a) " \
+ "nco:role(?a) " \
"\"NOTACALL\" \"false\" \"false\" <%s> " \
"WHERE { " \
"<%s> a nco:Contact . " \
"<%s> nco:hasAffiliation ?a . " \
"OPTIONAL { ?a nco:hasPhoneNumber ?w . }" \
"OPTIONAL { ?a nco:hasEmailAddress ?ew . }" \
+ "OPTIONAL { ?a nco:org ?o . } " \
"} " \
"}"
contact->nickname = g_strdup(reply[19]);
contact->website = g_strdup(reply[20]);
contact->photo = g_strdup(reply[21]);
+ contact->company = g_strdup(reply[22]);
+ contact->department = g_strdup(reply[23]);
+ contact->title = g_strdup(reply[24]);
set_call_type(contact, reply[COL_DATE], reply[COL_SENT],
reply[COL_ANSWERED]);
diff --git a/obexd/plugins/vcard.c b/obexd/plugins/vcard.c
index 05a8a13..0eed8ae 100644
--- a/obexd/plugins/vcard.c
+++ b/obexd/plugins/vcard.c
}
}
+static gboolean org_fields_present(struct phonebook_contact *contact)
+{
+ if (contact->company && strlen(contact->company))
+ return TRUE;
+
+ if (contact->department && strlen(contact->department))
+ return TRUE;
+
+ if (contact->title && strlen(contact->title))
+ return TRUE;
+
+ return FALSE;
+}
+
+static void vcard_printf_org(GString *vcards,
+ struct phonebook_contact *contact)
+{
+ if (org_fields_present(contact) == FALSE)
+ return;
+
+ vcard_printf(vcards, "ORG:%s;%s;%s", contact->company,
+ contact->department, contact->title);
+}
+
static void vcard_printf_adr(GString *vcards, struct phonebook_contact *contact)
{
if (address_fields_present(contact) == FALSE) {
if (filter & FILTER_PHOTO)
vcard_printf_tag(vcards, "PHOTO", NULL, contact->photo);
+ if (filter & FILTER_ORG)
+ vcard_printf_org(vcards, contact);
+
if (filter & FILTER_X_IRMC_CALL_DATETIME)
vcard_printf_datetime(vcards, contact);
g_free(contact->nickname);
g_free(contact->website);
g_free(contact->photo);
+ g_free(contact->company);
+ g_free(contact->department);
+ g_free(contact->title);
g_free(contact->datetime);
g_free(contact);
}
diff --git a/obexd/plugins/vcard.h b/obexd/plugins/vcard.h
index a9809ea..0f52425 100644
--- a/obexd/plugins/vcard.h
+++ b/obexd/plugins/vcard.h
char *nickname;
char *website;
char *photo;
+ char *company;
+ char *department;
+ char *title;
char *datetime;
int calltype;
};