a few file activities were not getting synced
This commit is contained in:
parent
52c6ea5115
commit
31e62bd19e
@ -35,11 +35,25 @@ class File_upload extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($_REQUEST['filename']) {
|
if($_REQUEST['filename']) {
|
||||||
$r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
|
$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']);
|
goaway(z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
|
$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']);
|
goaway(z_root() . '/' . $_REQUEST['return_url']);
|
||||||
|
|
||||||
|
@ -97,6 +97,12 @@ class Wall_attach extends \Zotlabs\Web\Controller {
|
|||||||
$s = "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";
|
$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)
|
if($using_api)
|
||||||
return $s;
|
return $s;
|
||||||
|
|
||||||
|
7
util/dcp
7
util/dcp
@ -54,10 +54,12 @@ if($argc != 3) {
|
|||||||
$folder = $x['data']['hash'];
|
$folder = $x['data']['hash'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hash = random_string();
|
||||||
|
|
||||||
$arr = [
|
$arr = [
|
||||||
'src' => $srcfile,
|
'src' => $srcfile,
|
||||||
'filename' => basename($srcfile),
|
'filename' => basename($srcfile),
|
||||||
'hash' => random_string(),
|
'hash' => $hash,
|
||||||
'allow_cid' => $channel['channel_allow_cid'],
|
'allow_cid' => $channel['channel_allow_cid'],
|
||||||
'allow_gid' => $channel['channel_allow_gid'],
|
'allow_gid' => $channel['channel_allow_gid'],
|
||||||
'deny_cid' => $channel['channel_deny_cid'],
|
'deny_cid' => $channel['channel_deny_cid'],
|
||||||
@ -70,4 +72,7 @@ if($argc != 3) {
|
|||||||
|
|
||||||
attach_store($channel,$channel['channel_hash'],'import',$arr);
|
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)));
|
||||||
|
|
||||||
|
@ -46,3 +46,12 @@ if($argc != 2) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
$x = attach_mkdirp($channel,$channel['channel_hash'],$arr);
|
$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)));
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user