diff options
author | redmatrix <git@macgirvin.com> | 2016-04-07 18:54:48 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-04-07 18:54:48 -0700 |
commit | 279f32b13deb45f3fe0ab2d32f6d2a0ea6e224e5 (patch) | |
tree | 02bc7d1b90498b585102f9c9f84afc19aba0b585 /include/attach.php | |
parent | 3a6187af3dba16bcada988593d5faabe62231651 (diff) | |
download | volse-hubzilla-279f32b13deb45f3fe0ab2d32f6d2a0ea6e224e5.tar.gz volse-hubzilla-279f32b13deb45f3fe0ab2d32f6d2a0ea6e224e5.tar.bz2 volse-hubzilla-279f32b13deb45f3fe0ab2d32f6d2a0ea6e224e5.zip |
send file sync packets for all known file operations
Diffstat (limited to 'include/attach.php')
-rw-r--r-- | include/attach.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/attach.php b/include/attach.php index 8d8cfe65f..ae4681994 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1820,7 +1820,7 @@ function filepath_macro($s) { } -function attach_export_data($channel,$resource_id) { +function attach_export_data($channel, $resource_id, $deleted = false) { $ret = array(); @@ -1828,6 +1828,15 @@ function attach_export_data($channel,$resource_id) { $hash_ptr = $resource_id; + $ret['fetch_url'] = z_root() . '/getfile'; + $ret['original_channel'] = $channel['channel_address']; + + + if($deleted) { + $ret['attach'] = array(array('hash' => $resource_id, 'deleted' => 1)); + return $ret; + } + do { $r = q("select * from attach where hash = '%s' and uid = %d limit 1", dbesc($hash_ptr), @@ -1836,16 +1845,15 @@ function attach_export_data($channel,$resource_id) { if(! $r) break; - if($hash_ptr === $resource_id) + if($hash_ptr === $resource_id) { $attach_ptr = $r[0]; + } $hash_ptr = $r[0]['folder']; $paths[] = $r[0]; } while($hash_ptr); - $ret['fetch_url'] = z_root() . '/getfile'; - $ret['original_channel'] = $channel['channel_address']; $paths = array_reverse($paths); |