aboutsummaryrefslogtreecommitdiffstats
path: root/addon/facebook
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-09 22:44:14 -0700
committerFriendika <info@friendika.com>2011-05-09 22:44:14 -0700
commit92622918313b863222256a54adf247a1f8ea6831 (patch)
tree0cc0492c4eaa2707ba89e8fd0534066f6cfb0d4e /addon/facebook
parenta5e0190f23a9b3ee840e98f9a819d688f6326781 (diff)
downloadvolse-hubzilla-92622918313b863222256a54adf247a1f8ea6831.tar.gz
volse-hubzilla-92622918313b863222256a54adf247a1f8ea6831.tar.bz2
volse-hubzilla-92622918313b863222256a54adf247a1f8ea6831.zip
re-fetch FB photos that failed
Diffstat (limited to 'addon/facebook')
-rw-r--r--addon/facebook/facebook.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index 2120459c3..76b26003c 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -141,6 +141,31 @@ function fb_get_friends($uid) {
);
if(count($r)) {
+
+ // check that we have all the photos, this has been known to fail on occasion
+
+ if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro'])) {
+ require_once("Photo.php");
+
+ $photos = import_profile_photo('https://graph.facebook.com/' . $jp->id . '/picture', $uid, $r[0]['id']);
+
+ $r = q("UPDATE `contact` SET `photo` = '%s',
+ `thumb` = '%s',
+ `micro` = '%s',
+ `name-date` = '%s',
+ `uri-date` = '%s',
+ `avatar-date` = '%s'
+ WHERE `id` = %d LIMIT 1
+ ",
+ dbesc($photos[0]),
+ dbesc($photos[1]),
+ dbesc($photos[2]),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ intval($r[0]['id'])
+ );
+ }
continue;
}
else {