pidgin/pidgin

Parents 274f63f95cc2
Children 9aeedc02a0e4
facebook: fb_api_cb_contacts: Make all the other fields optional too

Fixes "No matches for $.represented_profile.id" errors

Previously, 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.
--- a/libpurple/protocols/facebook/api.c Sat Oct 22 04:17:53 2016 -0300
+++ b/libpurple/protocols/facebook/api.c Sat Oct 22 04:32:07 2016 -0300
@@ -2064,11 +2064,11 @@
}
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");
@@ -2080,8 +2080,8 @@
uid = FB_ID_FROM_STR(str);
str = fb_json_values_next_str(values, NULL);
- if (!purple_strequal(str, "ARE_FRIENDS") &&
- (uid != priv->uid))
+ if ((!purple_strequal(str, "ARE_FRIENDS") &&
+ (uid != priv->uid)) || (uid == 0))
{
continue;
}