aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-06 20:25:52 -0700
committerredmatrix <git@macgirvin.com>2016-04-06 20:25:52 -0700
commitaa0412d83bd4ffb1e5208020ccae269e7cc13a3b (patch)
treeb7df9b1ca4f29414a9c9e7f6f11648417a82a20c
parent861f5232d3b6c5bd2cf8bd895f57424b730ce270 (diff)
downloadvolse-hubzilla-aa0412d83bd4ffb1e5208020ccae269e7cc13a3b.tar.gz
volse-hubzilla-aa0412d83bd4ffb1e5208020ccae269e7cc13a3b.tar.bz2
volse-hubzilla-aa0412d83bd4ffb1e5208020ccae269e7cc13a3b.zip
use the explicit form of build_sync_packet so that file/photo sync will work even when the actual observer is a guest (with permission to upload).
-rw-r--r--Zotlabs/Storage/Directory.php6
-rw-r--r--Zotlabs/Storage/File.php6
-rw-r--r--include/attach.php2
3 files changed, 13 insertions, 1 deletions
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php
index 0347ce087..95d7ebf46 100644
--- a/Zotlabs/Storage/Directory.php
+++ b/Zotlabs/Storage/Directory.php
@@ -335,6 +335,12 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
$p = photo_upload($c[0],\App::get_observer(),$args);
}
+ $sync = attach_export_data($c[0],$hash);
+
+ if($sync)
+ build_sync_packet($c[0]['channel_id'],array('file' => array($sync)));
+
+
}
/**
diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php
index a4bf3f49d..5c3dcd9c6 100644
--- a/Zotlabs/Storage/File.php
+++ b/Zotlabs/Storage/File.php
@@ -205,6 +205,12 @@ class File extends DAV\Node implements DAV\IFile {
return;
}
}
+
+ $sync = attach_export_data($c[0],$this->data['hash']);
+
+ if($sync)
+ build_sync_packet($c[0]['channel_id'],array('file' => array($sync)));
+
}
/**
diff --git a/include/attach.php b/include/attach.php
index aabcd2744..8d8cfe65f 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -868,7 +868,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$sync = attach_export_data($channel,$hash);
if($sync)
- build_sync_packet(0,array('file' => array($sync)));
+ build_sync_packet($channel['channel_id'],array('file' => array($sync)));
return $ret;
}