/soc/2015/jgeboski/facebook: 2b60f30897d9: facebook: do not erro...

James Geboski jgeboski at gmail.com
Sun Jun 28 17:59:47 EDT 2015


Changeset: 2b60f30897d99a3a861929bc07db292a503be53e
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2015-06-28 17:59 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/2b60f30897d9

Description:

facebook: do not error on icon retrieval failures

diffstat:

 libpurple/protocols/facebook/facebook.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (46 lines):

diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -32,6 +32,7 @@
 #include "api.h"
 #include "data.h"
 #include "facebook.h"
+#include "util.h"
 
 static PurpleProtocol *my_protocol = NULL;
 
@@ -70,7 +71,6 @@ fb_cb_data_icon(PurpleHttpConnection *co
 	const gchar *csum;
 	const gchar *name;
 	const gchar *str;
-	FbApi *api;
 	FbDataIcon *icon = data;
 	FbHttpParams *params;
 	GError *err = NULL;
@@ -80,10 +80,11 @@ fb_cb_data_icon(PurpleHttpConnection *co
 	PurpleHttpRequest *req;
 
 	acct = purple_buddy_get_account(icon->buddy);
-	api = fb_data_get_api(icon->fata);
+	name = purple_buddy_get_name(icon->buddy);
 
 	if (!fb_http_error_chk(res, &err)) {
-		fb_cb_api_error(api, err, icon->fata);
+		fb_util_debug_warning("Failed to retrieve icon for %s: %s",
+		                      name, err->message);
 		g_error_free(err);
 		return;
 	}
@@ -92,11 +93,9 @@ fb_cb_data_icon(PurpleHttpConnection *co
 	str = purple_http_request_get_url(req);
 	params = fb_http_params_new_parse(str, TRUE);
 	csum = fb_http_params_get_str(params, "oh", &err);
+	str = purple_http_response_get_data(res, &size);
 
-	name = purple_buddy_get_name(icon->buddy);
-	str = purple_http_response_get_data(res, &size);
 	idata = g_memdup(str, size);
-
 	purple_buddy_icons_set_for_user(acct, name, idata, size, csum);
 	fb_http_params_free(params);
 }



More information about the Commits mailing list