diff options
author | jgeboski <jgeboski@gmail.com> | 2016-01-16 09:47:24 -0500 |
---|---|---|
committer | jgeboski <jgeboski@gmail.com> | 2016-01-16 09:47:24 -0500 |
commit | 831597119787bf105b8a77307ca8525740531b53 (patch) | |
tree | 1379f18e01858718898494591ada84a826a06200 | |
parent | c4211e1114836ce0201ac29c58ff1eef3fe31cb8 (diff) | |
download | bitlbee-facebook-831597119787bf105b8a77307ca8525740531b53.tar.gz bitlbee-facebook-831597119787bf105b8a77307ca8525740531b53.tar.bz2 bitlbee-facebook-831597119787bf105b8a77307ca8525740531b53.tar.xz |
facebook-api: use the icon URL as a backup checksum
There is a report of the 'oh' parameter missing from some of the icon
images, which is used as the checksum. The solution is to simply use
the URL itself as the checksum in the *rare* case the 'oh' parameter
is missing.
-rw-r--r-- | facebook/facebook-api.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/facebook/facebook-api.c b/facebook/facebook-api.c index b7a2b9c..3f74198 100644 --- a/facebook/facebook-api.c +++ b/facebook/facebook-api.c @@ -1936,9 +1936,14 @@ fb_api_cb_contact(FbHttpRequest *req, gpointer data) prms = fb_http_values_new(); fb_http_values_parse(prms, user.icon, TRUE); - user.csum = fb_http_values_dup_str(prms, "oh", &err); + user.csum = fb_http_values_dup_str(prms, "oh", NULL); fb_http_values_free(prms); + if (G_UNLIKELY(user.csum == NULL)) { + /* Revert to the icon URL as the unique checksum */ + user.csum = g_strdup(user.icon); + } + g_signal_emit_by_name(api, "contact", &user); fb_api_user_reset(&user, TRUE); g_object_unref(values); @@ -2016,8 +2021,14 @@ fb_api_cb_contacts(FbHttpRequest *req, gpointer data) prms = fb_http_values_new(); fb_http_values_parse(prms, user->icon, TRUE); - user->csum = fb_http_values_dup_str(prms, "oh", &err); + user->csum = fb_http_values_dup_str(prms, "oh", NULL); fb_http_values_free(prms); + + if (G_UNLIKELY(user->csum == NULL)) { + /* Revert to the icon URL as the unique checksum */ + user->csum = g_strdup(user->icon); + } + users = g_slist_prepend(users, user); } |