aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-20 21:24:58 -0700
committerzotlabs <mike@macgirvin.com>2017-08-20 21:24:58 -0700
commit31e62bd19e2fcfe70487ab38ee6b688e48a79c95 (patch)
tree69a4b2308cf0dac50001ee012eb7405cd1969c31
parent52c6ea51152b6255b45ffb68181fa63413a6fffc (diff)
downloadvolse-hubzilla-31e62bd19e2fcfe70487ab38ee6b688e48a79c95.tar.gz
volse-hubzilla-31e62bd19e2fcfe70487ab38ee6b688e48a79c95.tar.bz2
volse-hubzilla-31e62bd19e2fcfe70487ab38ee6b688e48a79c95.zip
a few file activities were not getting synced
-rw-r--r--Zotlabs/Module/File_upload.php16
-rw-r--r--Zotlabs/Module/Wall_attach.php6
-rwxr-xr-xutil/dcp9
-rwxr-xr-xutil/dmkdir9
4 files changed, 37 insertions, 3 deletions
diff --git a/Zotlabs/Module/File_upload.php b/Zotlabs/Module/File_upload.php
index bce81ad7a..5c4b9a502 100644
--- a/Zotlabs/Module/File_upload.php
+++ b/Zotlabs/Module/File_upload.php
@@ -35,11 +35,25 @@ class File_upload extends \Zotlabs\Web\Controller {
if($_REQUEST['filename']) {
$r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
- if($r['success'])
+ if($r['success']) {
+ $hash = $r['data']['hash'];
+
+ $sync = attach_export_data($channel,$hash);
+ if($sync) {
+ build_sync_packet($channel['channel_id'],array('file' => array($sync)));
+ }
goaway(z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']);
+
+ }
}
else {
$r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
+ if($r['success']) {
+ $sync = attach_export_data($channel,$r['data']['hash']);
+ if($sync)
+ build_sync_packet($channel['channel_id'],array('file' => array($sync)));
+
+ }
}
goaway(z_root() . '/' . $_REQUEST['return_url']);
diff --git a/Zotlabs/Module/Wall_attach.php b/Zotlabs/Module/Wall_attach.php
index 03d4cb37b..e001ad929 100644
--- a/Zotlabs/Module/Wall_attach.php
+++ b/Zotlabs/Module/Wall_attach.php
@@ -97,6 +97,12 @@ class Wall_attach extends \Zotlabs\Web\Controller {
$s = "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";
}
+
+ $sync = attach_export_data($channel,$r['data']['hash']);
+ if($sync) {
+ build_sync_packet($channel['channel_id'],array('file' => array($sync)));
+ }
+
if($using_api)
return $s;
diff --git a/util/dcp b/util/dcp
index 86c25259f..14ff5d5d3 100755
--- a/util/dcp
+++ b/util/dcp
@@ -54,10 +54,12 @@ if($argc != 3) {
$folder = $x['data']['hash'];
}
+ $hash = random_string();
+
$arr = [
'src' => $srcfile,
'filename' => basename($srcfile),
- 'hash' => random_string(),
+ 'hash' => $hash,
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
@@ -70,4 +72,7 @@ if($argc != 3) {
attach_store($channel,$channel['channel_hash'],'import',$arr);
-
+ $sync = attach_export_data($channel,$hash);
+ if($sync)
+ build_sync_packet($channel['channel_id'],array('file' => array($sync)));
+
diff --git a/util/dmkdir b/util/dmkdir
index ffb1932e5..72ab22431 100755
--- a/util/dmkdir
+++ b/util/dmkdir
@@ -46,3 +46,12 @@ if($argc != 2) {
];
$x = attach_mkdirp($channel,$channel['channel_hash'],$arr);
+
+ if($x['success']) {
+ $hash = $x['data']['hash'];
+
+ $sync = attach_export_data($channel,$hash);
+ if($sync) {
+ build_sync_packet($channel['channel_id'],array('file' => array($sync)));
+ }
+ } \ No newline at end of file