aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-03 22:34:35 -0700
committerfriendica <info@friendica.com>2013-06-03 22:34:35 -0700
commit21491100f834372545569035e525ab74fc64cf26 (patch)
tree58bdb263c4f5044e531740b0cc3b80b304aa58af /include
parenta2584878017f933a3a2761754dd9d1eecf0c6e4f (diff)
downloadvolse-hubzilla-21491100f834372545569035e525ab74fc64cf26.tar.gz
volse-hubzilla-21491100f834372545569035e525ab74fc64cf26.tar.bz2
volse-hubzilla-21491100f834372545569035e525ab74fc64cf26.zip
fix buggered contact photos
Diffstat (limited to 'include')
-rw-r--r--include/poller.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/poller.php b/include/poller.php
index 433bc8caf..c076d30f7 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -85,6 +85,26 @@ function poller_run($argv, $argc){
proc_run('php','include/expire.php');
}
+ // update any photos which didn't get imported properly
+ // This should be rare
+
+ $r = q("select xchan_photo_l, xchan_hash from xchan where xchan_photo_l != '' and xchan_photo_m = ''
+ and xchan_photo_date < GMT_TIMESTAMP() - INTERVAL 1 DAY");
+ if($r) {
+ require_once('include/photo/photo_driver.php');
+ foreach($r as $rr) {
+ $photos = import_profile_photo($rr['xchan_photo_l'],$rr['xchan_hash']);
+ $x = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
+ where xchan_hash = '%s' limit 1",
+ dbesc($photos[0]),
+ dbesc($photos[1]),
+ dbesc($photos[2]),
+ dbesc($photos[3]),
+ dbesc($rr['xchan_hash'])
+ );
+ }
+ }
+
$manual_id = 0;
$generation = 0;