pidgin/pidgin

1852eb9052a0
Parents 9fd3018c170f
Children 643d7b0aadbd
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 25bab54.
--- a/libpurple/protocols/facebook/api.c Fri Dec 25 15:08:52 2015 -0500
+++ b/libpurple/protocols/facebook/api.c Fri Dec 25 15:20:41 2015 -0500
@@ -1970,6 +1970,7 @@
g_free(writeid);
writeid = fb_json_values_next_str_dup(values, NULL);
str = fb_json_values_next_str(values, NULL);
+ count++;
if (!purple_strequal(str, "ARE_FRIENDS")) {
continue;
@@ -1985,8 +1986,6 @@
prms = fb_http_params_new_parse(user->icon, TRUE);
user->csum = fb_http_params_dup_str(prms, "oh", &err);
fb_http_params_free(prms);
-
- count++;
users = g_slist_prepend(users, user);
}