]> git.mxchange.org Git - friendica-addons.git/commitdiff
refresh FB profile photos occasionally
authorfriendica <info@friendica.com>
Thu, 14 Jun 2012 05:42:22 +0000 (22:42 -0700)
committerfriendica <info@friendica.com>
Thu, 14 Jun 2012 05:42:22 +0000 (22:42 -0700)
facebook.tgz
facebook/facebook.php

index edddbb64a6faaf36f21af834556734eea2c82bcf..b8335178564f78d77624187d981123a41a680abe 100644 (file)
Binary files a/facebook.tgz and b/facebook.tgz differ
index f70524a62c77f7bcc18d9b8f8286098bfeaa0911..a59036dd65391b5f6fd82c32b38671750af27dcd 100644 (file)
@@ -270,9 +270,13 @@ function fb_get_friends_sync_parsecontact($uid, $contact) {
 
     if(count($r)) {
 
+               // update profile photos once every two weeks as we have no notification of when they change.
+
+               $update_photo = (($r[0]['avatar-date'] < datetime_convert('','','now -14 days')) ? true : false);
+
         // 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'])) {
+        if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro']) || ($update_photo)) {
             require_once("Photo.php");
 
             $photos = import_profile_photo('https://graph.facebook.com/' . $contact->id . '/picture', $uid, $r[0]['id']);