aboutsummaryrefslogtreecommitdiffstats
path: root/include/RedDAV/RedDirectory.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-27 16:36:30 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-27 16:36:30 -0700
commit8d84472b4cb85b50c314491e0706d80eb5b7de6d (patch)
tree1c442f5ccb5b9b11dc2108e0da87be240562926f /include/RedDAV/RedDirectory.php
parentb43c0bc471fa7a9afa7e735d1cf0e209372a3477 (diff)
downloadvolse-hubzilla-8d84472b4cb85b50c314491e0706d80eb5b7de6d.tar.gz
volse-hubzilla-8d84472b4cb85b50c314491e0706d80eb5b7de6d.tar.bz2
volse-hubzilla-8d84472b4cb85b50c314491e0706d80eb5b7de6d.zip
bring single instance file storage to dav and cloud uploaded photos
Diffstat (limited to 'include/RedDAV/RedDirectory.php')
-rw-r--r--include/RedDAV/RedDirectory.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/RedDAV/RedDirectory.php b/include/RedDAV/RedDirectory.php
index c41056ac9..1f7ba8927 100644
--- a/include/RedDAV/RedDirectory.php
+++ b/include/RedDAV/RedDirectory.php
@@ -297,8 +297,18 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
}
if($is_photo) {
+ $album = '';
+ if($this->folder_hash) {
+ $f1 = q("select filename from attach WHERE hash = '%s' AND uid = %d",
+ dbesc($this->folder_hash),
+ intval($c[0]['channel_id'])
+ );
+ if($f1)
+ $album = $f1[0]['filename'];
+ }
+
require_once('include/photos.php');
- $args = array( 'data' => @file_get_contents($f), 'resource_id' => $hash);
+ $args = array( 'resource_id' => $hash, 'album' => $album, 'os_path' => $f, 'filename' => $name, 'getimagesize' => $x);
$p = photo_upload($c[0],get_app()->get_observer(),$args);
}