aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjgeboski <jgeboski@gmail.com>2015-12-25 16:08:57 -0500
committerjgeboski <jgeboski@gmail.com>2015-12-25 16:08:57 -0500
commitc2a7c914d3d218124cb3cfd7ca422d2d7c37fa67 (patch)
treedef805b147fadce359f3d5ca35ac31e7ccdd025f
parentd23df657328e4f565dfba973885be7c5d2b35eae (diff)
downloadbitlbee-facebook-c2a7c914d3d218124cb3cfd7ca422d2d7c37fa67.tar.gz
bitlbee-facebook-c2a7c914d3d218124cb3cfd7ca422d2d7c37fa67.tar.bz2
bitlbee-facebook-c2a7c914d3d218124cb3cfd7ca422d2d7c37fa67.tar.xz
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.
-rw-r--r--facebook/facebook-api.c3
1 files changed, 1 insertions, 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);
}