From 9f37dbc6dc1798b9b56a683ed1975adc318ff931 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 22 Aug 2017 18:29:51 -0700 Subject: util/dcp - support recursion and folders full of photos by importing files singly in separate processes - not yet tested --- Zotlabs/Daemon/Importfile.php | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Zotlabs/Daemon/Importfile.php (limited to 'Zotlabs/Daemon') diff --git a/Zotlabs/Daemon/Importfile.php b/Zotlabs/Daemon/Importfile.php new file mode 100644 index 000000000..5f15b811d --- /dev/null +++ b/Zotlabs/Daemon/Importfile.php @@ -0,0 +1,45 @@ + 3) ? $argv[3] : ''); + $dstname = (($argc > 4) ? $argv[4] : ''); + + $hash = random_string(); + + $arr = [ + 'src' => $srcfile, + 'filename' => (($dstname) ? $dstname : basename($srcfile)), + 'hash' => $hash, + 'allow_cid' => $channel['channel_allow_cid'], + 'allow_gid' => $channel['channel_allow_gid'], + 'deny_cid' => $channel['channel_deny_cid'], + 'deny_gid' => $channel['channel_deny_gid'], + 'preserve_original' => true, + 'replace' => true + ]; + + if($folder) + $arr['folder'] = $folder; + + 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))); + + return; + } +} -- cgit v1.2.3 From 182f94a9ac8cfcd414d6f5899fbeb7a8e65284da Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 22 Aug 2017 19:41:16 -0700 Subject: allow cards to federate --- Zotlabs/Daemon/Notifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Daemon') diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 6763e0ef4..33dcbbf20 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -276,7 +276,7 @@ class Notifier { $deleted_item = true; } - if(intval($target_item['item_type']) != ITEM_TYPE_POST) { + if(! in_array(intval($target_item['item_type']), [ ITEM_TYPE_POST, ITEM_TYPE_CARD ] )) { logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG); return; } -- cgit v1.2.3 From 41ff8fdd375fcf395b547dd02f3bdcbb198ec0c1 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 22 Aug 2017 20:32:02 -0700 Subject: test recursive dav copy --- Zotlabs/Daemon/Importfile.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Zotlabs/Daemon') diff --git a/Zotlabs/Daemon/Importfile.php b/Zotlabs/Daemon/Importfile.php index 5f15b811d..c68ed21cf 100644 --- a/Zotlabs/Daemon/Importfile.php +++ b/Zotlabs/Daemon/Importfile.php @@ -6,6 +6,8 @@ class Importfile { static public function run($argc,$argv){ + logger('Importfile: ' . print_r($argv,true)); + if($argc < 3) return; -- cgit v1.2.3 From e084b776eee9f1fc66e3f4a37b92ec70ccc49286 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 23 Aug 2017 00:01:02 -0700 Subject: cards feature --- Zotlabs/Daemon/Notifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Daemon') diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 33dcbbf20..e8cd4dac8 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -276,7 +276,7 @@ class Notifier { $deleted_item = true; } - if(! in_array(intval($target_item['item_type']), [ ITEM_TYPE_POST, ITEM_TYPE_CARD ] )) { + if(! in_array(intval($target_item['item_type']), [ ITEM_TYPE_POST ] )) { logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG); return; } -- cgit v1.2.3