diff options
author | zotlabs <mike@macgirvin.com> | 2017-12-06 14:20:17 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-12-06 14:20:17 -0800 |
commit | ffaab27e77844c47501b9fd8202a6b94792c3686 (patch) | |
tree | 16fd0a543431964730f4c5840146cbc439dc349d /include/import.php | |
parent | 157966eb115606ef1d25fc55e90cb25fec1b6333 (diff) | |
download | volse-hubzilla-ffaab27e77844c47501b9fd8202a6b94792c3686.tar.gz volse-hubzilla-ffaab27e77844c47501b9fd8202a6b94792c3686.tar.bz2 volse-hubzilla-ffaab27e77844c47501b9fd8202a6b94792c3686.zip |
synchronise an attach_move operation to clones
Diffstat (limited to 'include/import.php')
-rw-r--r-- | include/import.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/import.php b/include/import.php index 8cab16342..cd7056497 100644 --- a/include/import.php +++ b/include/import.php @@ -1081,6 +1081,7 @@ function sync_files($channel, $files) { logger('sync_files duplicate check: attach_by_hash() returned ' . print_r($x,true), LOGGER_DEBUG); if($x['success']) { + $orig_attach = $x[0]; $attach_exists = true; $attach_id = $x[0]['id']; } @@ -1145,12 +1146,18 @@ function sync_files($channel, $files) { // If the hash ever contains any escapable chars this could cause // problems. Currently it does not. - /// @TODO implement os_path if(!isset($att['os_path'])) $att['os_path'] = ''; if($attach_exists) { logger('sync_files attach exists: ' . print_r($att,true), LOGGER_DEBUG); + + // process/sync a remote rename/move operation + + if($orig_attach['content'] !== $newfname) { + rename($orig_attach['content'],$newfname); + } + if(! dbesc_array($att)) continue; |