diff options
author | dequis <dx@dxzone.com.ar> | 2016-06-06 03:03:10 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2016-06-06 03:03:10 -0300 |
commit | 609ca2d52d468863c99ff3539917f2049ea3df44 (patch) | |
tree | 6d7d8adab91e9d45240d8bacad91bb940156fac5 | |
parent | e982a3d0983d9d18c6b147b6c80cbe80d12a4a50 (diff) | |
download | bitlbee-facebook-609ca2d52d468863c99ff3539917f2049ea3df44.tar.gz bitlbee-facebook-609ca2d52d468863c99ff3539917f2049ea3df44.tar.bz2 bitlbee-facebook-609ca2d52d468863c99ff3539917f2049ea3df44.tar.xz |
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.
-rw-r--r-- | facebook/facebook-api.c | 10 |
1 files 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; } |