aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-01-24 19:55:50 +0000
committerMario <mario@mariovavti.com>2021-01-24 19:55:50 +0000
commite486442eb1fdda0c4efa7eafc6d876b3c2c4b0ea (patch)
tree6069feeaca13ff6369a8fead9e047f2471cf3a04
parent2035828042e50f2c23f55d80b19fb898b170e6e5 (diff)
parent6b0c61ac6bf45993f5d89b976c4d11c7e287aa38 (diff)
downloadvolse-hubzilla-e486442eb1fdda0c4efa7eafc6d876b3c2c4b0ea.tar.gz
volse-hubzilla-e486442eb1fdda0c4efa7eafc6d876b3c2c4b0ea.tar.bz2
volse-hubzilla-e486442eb1fdda0c4efa7eafc6d876b3c2c4b0ea.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
-rw-r--r--Zotlabs/Lib/Libzot.php5
-rw-r--r--include/photo/photo_driver.php11
2 files changed, 14 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 150a6af03..ee1f54ec8 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -795,7 +795,10 @@ class Libzot {
dbesc($xchan_hash)
);
if ($local) {
- $ph = z_fetch_url($arr['photo']['url'], true);
+
+ $ph = false;
+ if (strpos($arr['photo']['url'], z_root()) === false)
+ $ph = z_fetch_url($arr['photo']['url'], true);
if ($ph['success']) {
$hash = import_channel_photo($ph['body'], $arr['photo']['type'], $local[0]['channel_account_id'], $local[0]['channel_id']);
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index f61919eea..1ce2fd6e3 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -401,8 +401,17 @@ function import_channel_photo($photo, $type, $aid, $uid) {
logger('Importing channel photo for ' . $uid, LOGGER_DEBUG);
+ $r = q("SELECT resource_id FROM photo WHERE uid = %d AND photo_usage = %d AND imgscale = %d",
+ intval($uid),
+ intval(PHOTO_PROFILE),
+ intval(PHOTO_RES_PROFILE_300)
+ );
+ if ($r)
+ $hash = $r[0]['resource_id'];
+ else
+ $hash = photo_new_resource();
+
$photo_failure = false;
- $hash = photo_new_resource();
$filename = $hash;
$img = photo_factory($photo, $type);