From 1cce8a4cb6e436543ce97a423270917e9b1af44c Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Wed, 12 May 2010 15:12:17 -0300 Subject: [PATCH] obexd: Fix owner vCard not having the first handle The spec mandates that the owner vCard must have handle 0.vcf. --- obexd/plugins/phonebook-tracker.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c index 894d781de..a8cbb4542 100644 --- a/obexd/plugins/phonebook-tracker.c +++ b/obexd/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); -- 2.47.3