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 /Zotlabs/Storage/File.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 'Zotlabs/Storage/File.php')
-rw-r--r-- | Zotlabs/Storage/File.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index 5c3dcd9c6..897f24edd 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -84,6 +84,20 @@ class File extends DAV\Node implements DAV\IFile { dbesc($this->data['hash']), intval($this->data['id']) ); + + if($this->data->is_photo) { + $r = q("update photo set filename = '%s' where resource_id = '%s' and uid = %d", + dbesc($newName), + dbesc($this->data['hash']), + intval($this->auth->owner_id) + ); + } + $ch = channelx_by_n($this->auth->owner_id); + if($ch) { + $sync = attach_export_data($ch,$this->data['hash']); + if($sync) + build_sync_packet($ch['channel_id'],array('file' => array($sync))); + } } /** @@ -324,5 +338,12 @@ class File extends DAV\Node implements DAV\IFile { } attach_delete($this->auth->owner_id, $this->data['hash']); + + $ch = channelx_by_n($this->auth->owner_id); + if($ch) { + $sync = attach_export_data($ch,$this->data['hash'],true); + if($sync) + build_sync_packet($ch['channel_id'],array('file' => array($sync))); + } } } |