From c2a7c914d3d218124cb3cfd7ca422d2d7c37fa67 Mon Sep 17 00:00:00 2001 From: jgeboski Date: Fri, 25 Dec 2015 16:08:57 -0500 Subject: facebook: fixed broken contact counting with non-friends When fetching more than 500 contacts, multiple requests must be made in order avoid request limits. When friends are retrieved and processed, the plugin must keep a count of the processed contacts to know whether or not it needs to retrieve more contacts. Currently, this counter assumes every contact is a friend, which is not always the case. This counter needs to advance even when a contact is not a friend. This fixes the incomplete fetching of the buddy list when a user has over 500 friends. This is a regression introduced by 00c0ae8. --- facebook/facebook-api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/facebook/facebook-api.c b/facebook/facebook-api.c index cbddc32..8e55dd4 100644 --- a/facebook/facebook-api.c +++ b/facebook/facebook-api.c @@ -1910,6 +1910,7 @@ fb_api_cb_contacts(FbHttpRequest *req, gpointer data) g_free(writeid); writeid = fb_json_values_next_str_dup(values, NULL); str = fb_json_values_next_str(values, NULL); + count++; if (g_strcmp0(str, "ARE_FRIENDS") != 0) { continue; @@ -1926,8 +1927,6 @@ fb_api_cb_contacts(FbHttpRequest *req, gpointer data) fb_http_values_parse(prms, user->icon, TRUE); user->csum = fb_http_values_dup_str(prms, "oh", &err); fb_http_values_free(prms); - - count++; users = g_slist_prepend(users, user); } -- cgit v1.2.3