From 609ca2d52d468863c99ff3539917f2049ea3df44 Mon Sep 17 00:00:00 2001 From: dequis Date: Mon, 6 Jun 2016 03:03:10 -0300 Subject: fb_api_cb_contacts: Make all the other fields optional too Fixes #89 (No matches for $.represented_profile.id) Previously, in 4efa397, hugePictureUrl was made optional. Now someone complains about represented_profile being missing, replaced with a null. To be honest I'm worried about what kind of bug might be breaking things so subtly on the server side, but well, it's not my job. This will result in some friends with missing represented_profile not being included in the contact list, because we're missing rather essential information. But better than not being able to log in. --- facebook/facebook-api.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/facebook/facebook-api.c b/facebook/facebook-api.c index 213937e..827b70e 100644 --- a/facebook/facebook-api.c +++ b/facebook/facebook-api.c @@ -2004,11 +2004,11 @@ fb_api_cb_contacts(FbHttpRequest *req, gpointer data) } values = fb_json_values_new(root); - fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE, + fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.represented_profile.id"); - fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE, + fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.represented_profile.friendship_status"); - fb_json_values_add(values, FB_JSON_TYPE_STR, TRUE, + fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.structured_name.text"); fb_json_values_add(values, FB_JSON_TYPE_STR, FALSE, "$.hugePictureUrl.uri"); @@ -2020,8 +2020,8 @@ fb_api_cb_contacts(FbHttpRequest *req, gpointer data) uid = FB_ID_FROM_STR(str); str = fb_json_values_next_str(values, NULL); - if ((g_strcmp0(str, "ARE_FRIENDS") != 0) && - (uid != priv->uid)) + if (((g_strcmp0(str, "ARE_FRIENDS") != 0) && + (uid != priv->uid)) || (uid == 0)) { continue; } -- cgit v1.2.3