/pidgin/main: 1852eb9052a0: facebook: fixed broken contact count...

James Geboski jgeboski at gmail.com
Fri Dec 25 15:23:47 EST 2015

Changeset: 1852eb9052a002661626e58ae4c2be92c2566d8f
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2015-12-25 15:20 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/1852eb9052a0


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.


 libpurple/protocols/facebook/api.c |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (20 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -1970,6 +1970,7 @@ fb_api_cb_contacts(PurpleHttpConnection 
 		writeid = fb_json_values_next_str_dup(values, NULL);
 		str = fb_json_values_next_str(values, NULL);
+		count++;
 		if (!purple_strequal(str, "ARE_FRIENDS")) {
@@ -1985,8 +1986,6 @@ fb_api_cb_contacts(PurpleHttpConnection 
 		prms = fb_http_params_new_parse(user->icon, TRUE);
 		user->csum = fb_http_params_dup_str(prms, "oh", &err);
-		count++;
 		users = g_slist_prepend(users, user);

More information about the Commits mailing list