summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vcgomes@gmail.com>2010-05-12 15:12:17 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2010-05-14 15:59:23 +0300
commit2ae8db23f036e3294be3fdca87a0b7c94fd82471 (patch)
tree501cc1e60d3799238053cb2d6c32039aed2eea76
parent3fd4aa58522a4eb0254c01506495573559fad293 (diff)
downloadobexd-2ae8db23f036e3294be3fdca87a0b7c94fd82471.tar.gz
Fix owner vCard not having the first handle
The spec mandates that the owner vCard must have handle 0.vcf.
-rw-r--r--plugins/phonebook-tracker.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index 894d781..a8cbb45 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -519,8 +519,13 @@ static void add_to_cache(char **reply, int num_fields, void *user_data)
formatted = g_strdup_printf("%s;%s;%s;%s;%s", reply[1], reply[2],
reply[3], reply[4], reply[5]);
- cache->entry_cb(reply[0], PHONEBOOK_INVALID_HANDLE, formatted, "",
+ /* The owner vCard must have the 0 handle */
+ if (strcmp(reply[0], TRACKER_DEFAULT_CONTACT_ME) == 0)
+ cache->entry_cb(reply[0], 0, formatted, "",
reply[6], cache->user_data);
+ else
+ cache->entry_cb(reply[0], PHONEBOOK_INVALID_HANDLE, formatted,
+ "", reply[6], cache->user_data);
g_free(formatted);