Merge branch 'dev' of /home/macgirvin/z into dev

This commit is contained in:
nobody 2021-01-08 13:56:06 -08:00
commit d0fe0d6da9
5 changed files with 14 additions and 76 deletions

View file

@ -34,6 +34,7 @@ use Zotlabs\Lib\Apps;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\AccessControl;
use Zotlabs\Daemon\Run;
use App;
use URLify;
@ -1399,7 +1400,7 @@ class Item extends Controller {
}
}
if(! $nopush)
\Zotlabs\Daemon\Run::Summon(array('Notifier', 'edit_post', $post_id));
Run::Summon(array('Notifier', 'edit_post', $post_id));
if($api_source)
@ -1524,7 +1525,7 @@ class Item extends Controller {
}
if(! $nopush) {
\Zotlabs\Daemon\Run::Summon(array('Notifier', $notify_type, $post_id));
Run::Summon(array('Notifier', $notify_type, $post_id));
}
logger('post_complete');

View file

@ -10,10 +10,10 @@ class Uexport extends Controller {
if (! local_channel()) {
return;
}
if (argc() > 1) {
$sections = (($_REQUEST['sections']) ? explode(',',$_REQUEST['sections']) : '');
$sections = (($_REQUEST['sections']) ? explode(',',$_REQUEST['sections']) : get_default_export_sections());
if (argc() > 1) {
$channel = App::get_channel();
@ -28,20 +28,21 @@ class Uexport extends Controller {
header('content-type: application/json');
header('Content-Disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . (($_REQUEST['sections']) ? '-' . $_REQUEST['sections'] : '') . '.json"' );
$flags = ((version_compare(PHP_VERSION,'7.2.0') >= 0) ? JSON_INVALID_UTF8_SUBSTITUTE : 0);
if ($year) {
echo json_encode(identity_export_year(local_channel(),$year,$month));
echo json_encode(identity_export_year(local_channel(),$year,$month), $flags);
killme();
}
if (argc() > 1 && argv(1) === 'basic') {
echo json_encode(identity_basic_export(local_channel(),$sections));
echo json_encode(identity_basic_export(local_channel(),$sections), $flags);
killme();
}
// Warning: this option may consume a lot of memory
if(argc() > 1 && argv(1) === 'complete') {
$sections = get_default_export_sections();
$sections[] = 'items';
echo json_encode(identity_basic_export(local_channel(),$sections));
killme();

View file

@ -16,7 +16,7 @@ use Zotlabs\Daemon\Run;
* @brief This file defines some global constants and includes the central App class.
*/
define ( 'STD_VERSION', '20.12.24' );
define ( 'STD_VERSION', '21.01.09' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1247 );

View file

@ -766,10 +766,7 @@ function get_default_export_sections() {
'config',
'apps',
'chatrooms',
'events',
'webpages',
'mail',
'wikis'
'events'
];
$cb = [ 'sections' => $sections ];
@ -1016,69 +1013,6 @@ function identity_basic_export($channel_id, $sections = null) {
}
}
if (in_array('webpages',$sections)) {
$x = menu_list($channel_id);
if ($x) {
$ret['menu'] = array();
for ($y = 0; $y < count($x); $y ++) {
$m = menu_fetch($x[$y]['menu_name'],$channel_id,$ret['channel']['channel_hash']);
if ($m) {
$ret['menu'][] = menu_element($ret['channel'],$m);
}
}
}
$r = q("select * from item where item_type in ( "
. ITEM_TYPE_BLOCK . "," . ITEM_TYPE_PDL . "," . ITEM_TYPE_WEBPAGE . " ) and uid = %d",
intval($channel_id)
);
if ($r) {
$ret['webpages'] = array();
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach ($r as $rr) {
$ret['webpages'][] = encode_item($rr,true);
}
}
}
if (in_array('mail',$sections)) {
$r = q("select * from conv where uid = %d",
intval($channel_id)
);
if ($r) {
for ($x = 0; $x < count($r); $x ++) {
$r[$x]['subject'] = base64url_decode(str_rot47($r[$x]['subject']));
}
$ret['conv'] = $r;
}
$r = q("select * from mail where channel_id = %d",
intval($channel_id)
);
if ($r) {
$m = array();
foreach ($r as $rr) {
xchan_mail_query($rr);
$m[] = encode_mail($rr,true);
}
$ret['mail'] = $m;
}
}
if (in_array('wikis',$sections)) {
$r = q("select * from item where resource_type like 'nwiki%%' and uid = %d order by created",
intval($channel_id)
);
if ($r) {
$ret['wiki'] = array();
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach ($r as $rv) {
$ret['wiki'][] = encode_item($rv,true);
}
}
}
if (in_array('items', $sections)) {
/** @warning this may run into memory limits on smaller systems */

View file

@ -2997,6 +2997,8 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
// $mention = '@[zrl=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/zrl]';
$arr['body'] = $bb;
$arr['term'] = $item['term'];
$arr['author_xchan'] = $channel['channel_hash'];
$arr['owner_xchan'] = $channel['channel_hash'];