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

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 1852eb9052a002661626e58ae4c2be92c2566d8f
Author:	 James Geboski <[email protected]>
Date:	 2015-12-25 15:20 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/1852eb9052a0

Description:

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.

diffstat:

 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 
 		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 @@ fb_api_cb_contacts(PurpleHttpConnection 
 		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);
 	}
 

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.