Diff between 49db95b2dea6fbd2b02eaddc11ff4cf1db67ae45 and 65e2e08584664fba9f265404a05f33246333582f

Changed Files

File Additions Deletions Status
obexd/plugins/phonebook-tracker.c +17 -0 modified

Full Patch

diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c
index 96290a4..284d687 100644
--- a/obexd/plugins/phonebook-tracker.c
+++ b/obexd/plugins/phonebook-tracker.c
@@ -1094,6 +1094,16 @@ fail:
 	g_free(data);
 }
 
+static void add_affiliation(char **field, const char *value)
+{
+	if (strlen(*field) > 0 || value == NULL || strlen(value) == 0)
+		return;
+
+	g_free(*field);
+
+	*field = g_strdup(value);
+}
+
 static void pull_contacts(char **reply, int num_fields, void *user_data)
 {
 	struct phonebook_data *data = user_data;
@@ -1196,6 +1206,13 @@ add_numbers:
 	g_free(home_addr);
 	g_free(work_addr);
 
+	/* Adding fields connected by nco:hasAffiliation - they may be in
+	 * separate replies */
+	add_affiliation(&contact->title, reply[33]);
+	add_affiliation(&contact->company, reply[22]);
+	add_affiliation(&contact->department, reply[23]);
+	add_affiliation(&contact->role, reply[24]);
+
 	DBG("contact %p", contact);
 
 	/* Adding contacts data to wrapper struct - this data will be used to