mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:35:30 +00:00
file sync issues related to thumbnail os_storage
This commit is contained in:
parent
e9f923a5c0
commit
b03fc197aa
2 changed files with 23 additions and 16 deletions
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Web\Controller;
|
||||
use Zotlabs\Web\HTTPSig;
|
||||
|
||||
/**
|
||||
* module: getfile
|
||||
*
|
||||
|
@ -24,7 +27,8 @@ namespace Zotlabs\Module;
|
|||
require_once('include/attach.php');
|
||||
|
||||
|
||||
class Getfile extends \Zotlabs\Web\Controller {
|
||||
|
||||
class Getfile extends Controller {
|
||||
|
||||
function post() {
|
||||
|
||||
|
@ -53,7 +57,7 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||
continue;
|
||||
}
|
||||
|
||||
$verified = \Zotlabs\Web\HTTPSig::verify('');
|
||||
$verified = HTTPSig::verify('');
|
||||
if($verified && $verified['header_signed'] && $verified['header_valid']) {
|
||||
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' or hubloc_addr = '%s' limit 1",
|
||||
dbesc($verified['signer']),
|
||||
|
|
|
@ -1424,12 +1424,13 @@ function sync_files($channel, $files) {
|
|||
|
||||
$time = datetime_convert();
|
||||
|
||||
$parr = array('hash' => $channel['channel_hash'],
|
||||
'time' => $time,
|
||||
'resource' => $att['hash'],
|
||||
'revision' => 0,
|
||||
$parr = [
|
||||
'hash' => $channel['channel_hash'],
|
||||
'time' => $time,
|
||||
'resource' => $att['hash'],
|
||||
'revision' => 0,
|
||||
'signature' => Libzot::sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey'])
|
||||
);
|
||||
];
|
||||
|
||||
$store_path = $newfname;
|
||||
|
||||
|
@ -1504,23 +1505,25 @@ function sync_files($channel, $files) {
|
|||
);
|
||||
}
|
||||
|
||||
if (intval($p['imgscale']) === 0 && $p['os_storage']) {
|
||||
$p['content'] = $store_path;
|
||||
if (intval($p['os_storage'])) {
|
||||
$p['content'] = $store_path . ((intval($p['imgscale'])) ? '-' . $p['imgscale'] : EMPTY_STR);
|
||||
}
|
||||
else {
|
||||
$p['content'] = (($p['content'])? base64_decode($p['content']) : '');
|
||||
$p['content'] = (($p['content']) ? base64_decode($p['content']) : '');
|
||||
}
|
||||
|
||||
if (intval($p['imgscale']) && (! $p['content'])) {
|
||||
|
||||
$time = datetime_convert();
|
||||
|
||||
$parr = array('hash' => $channel['channel_hash'],
|
||||
'time' => $time,
|
||||
'resource' => $att['hash'],
|
||||
'revision' => 0,
|
||||
'signature' => zot_sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey']),
|
||||
$parr = [
|
||||
'hash' => $channel['channel_hash'],
|
||||
'time' => $time,
|
||||
'resource' => $att['hash'],
|
||||
'revision' => 0,
|
||||
'signature' => Libzot::sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey']),
|
||||
'resolution' => $p['imgscale']
|
||||
);
|
||||
];
|
||||
|
||||
$stored_image = $newfname . '-' . intval($p['imgscale']);
|
||||
|
||||
|
|
Loading…
Reference in a new issue